Class: Eskimo::Components::Indent
- Inherits:
-
Eskimo::Component
- Object
- Eskimo::Component
- Eskimo::Components::Indent
- Defined in:
- lib/eskimo/components/indent.rb
Overview
Instance Attribute Summary collapse
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(width: 4, &children) ⇒ Indent
constructor
A new instance of Indent.
- #render ⇒ Object
Constructor Details
#initialize(width: 4, &children) ⇒ Indent
Returns a new instance of Indent
15 16 17 18 |
# File 'lib/eskimo/components/indent.rb', line 15 def initialize(width: 4, &children) @width = width super end |
Instance Attribute Details
#width ⇒ Object (readonly)
Returns the value of attribute width
13 14 15 |
# File 'lib/eskimo/components/indent.rb', line 13 def width @width end |
Instance Method Details
#render ⇒ Object
20 21 22 |
# File 'lib/eskimo/components/indent.rb', line 20 def render(**) Strings.pad(super, [0,0,0,width]) end |