class Chamomile::Widgets::Text
Plain text block.
Attributes
Public Class Methods
Source
# File lib/chamomile/frame.rb, line 100 def initialize(content: "") @content = content end
Public Instance Methods
Source
# File lib/chamomile/frame.rb, line 104 def render(width: 80, height: 24) lines = @content.split("\n", -1) lines = lines[0, height] if lines.length > height lines.map { |l| l.length > width ? l[0, width] : l }.join("\n") end