Class: LiquidComponent::Component
- Inherits:
-
Object
- Object
- LiquidComponent::Component
- Defined in:
- lib/liquid-component/component.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
Instance Method Summary collapse
- #additional_metadata ⇒ Object
- #description ⇒ Object
-
#initialize(metadata:, content:) ⇒ Component
constructor
A new instance of Component.
- #name ⇒ Object
- #to_h ⇒ Object
- #variables ⇒ Object
Constructor Details
#initialize(metadata:, content:) ⇒ Component
Returns a new instance of Component.
5 6 7 8 |
# File 'lib/liquid-component/component.rb', line 5 def initialize(metadata:, content:) self. = self.content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/liquid-component/component.rb', line 3 def content @content end |
#metadata ⇒ Object
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/liquid-component/component.rb', line 3 def end |
Instance Method Details
#additional_metadata ⇒ Object
22 23 24 |
# File 'lib/liquid-component/component.rb', line 22 def .additional end |
#description ⇒ Object
14 15 16 |
# File 'lib/liquid-component/component.rb', line 14 def description .description end |
#name ⇒ Object
10 11 12 |
# File 'lib/liquid-component/component.rb', line 10 def name .name end |
#to_h ⇒ Object
26 27 28 29 30 31 |
# File 'lib/liquid-component/component.rb', line 26 def to_h { metadata: .to_h, content: content } end |
#variables ⇒ Object
18 19 20 |
# File 'lib/liquid-component/component.rb', line 18 def variables .variables end |