Class: Eskimo::ASCII::Wrap

Inherits:
Component show all
Defined in:
gems/eskimo-ascii/lib/eskimo/ascii/components/wrap.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width: Constants::SCREEN_COLUMNS, &children) ⇒ Wrap

Returns a new instance of Wrap



15
16
17
18
# File 'gems/eskimo-ascii/lib/eskimo/ascii/components/wrap.rb', line 15

def initialize(width: Constants::SCREEN_COLUMNS, &children)
  @width = width
  super
end

Instance Attribute Details

#widthObject (readonly)

Returns the value of attribute width



13
14
15
# File 'gems/eskimo-ascii/lib/eskimo/ascii/components/wrap.rb', line 13

def width
  @width
end

Instance Method Details

#renderObject



20
21
22
# File 'gems/eskimo-ascii/lib/eskimo/ascii/components/wrap.rb', line 20

def render(**)
  Strings.wrap(super, width)
end