Class: Eskimo::Components::Indent
- Inherits:
-
Eskimo::Component
- Object
- Eskimo::Component
- Eskimo::Components::Indent
- Defined in:
- lib/eskimo/components.rb
Overview
Indent text from the left.
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.
11 12 13 14 |
# File 'lib/eskimo/components.rb', line 11 def initialize(width: 4, &children) @width = width super(&children) end |
Instance Attribute Details
#width ⇒ Object (readonly)
Returns the value of attribute width.
9 10 11 |
# File 'lib/eskimo/components.rb', line 9 def width @width end |
Instance Method Details
#render ⇒ Object
16 17 18 |
# File 'lib/eskimo/components.rb', line 16 def render(**) Strings.pad(super, [0,0,0,width]).rstrip end |