Class: Rubord::Components::Text
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Rubord::Components::Text
- Defined in:
- lib/rubord/components/containers/text.rb
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
-
#initialize(*content) ⇒ Text
constructor
A new instance of Text.
- #to_h ⇒ Object
Constructor Details
#initialize(*content) ⇒ Text
Returns a new instance of Text.
6 7 8 9 |
# File 'lib/rubord/components/containers/text.rb', line 6 def initialize(*content) super(10) @content = content end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 |
# File 'lib/rubord/components/containers/text.rb', line 11 def to_h { type: @type, content: @content.join("\n") } end |