Class: Locomotive::Wagon::SectionDecorator
- Inherits:
-
Steam::Decorators::TemplateDecorator
- Object
- Steam::Decorators::TemplateDecorator
- Locomotive::Wagon::SectionDecorator
- Includes:
- PersistAssetsConcern, ToHashConcern
- Defined in:
- lib/locomotive/wagon/decorators/section_decorator.rb
Instance Attribute Summary collapse
-
#__content_assets_pusher__ ⇒ Object
Returns the value of attribute content_assets_pusher.
Instance Method Summary collapse
- #__attributes__ ⇒ Object
- #definition ⇒ Object
- #id ⇒ Object
-
#initialize(object, content_assets_pusher) ⇒ SectionDecorator
constructor
A new instance of SectionDecorator.
- #template ⇒ Object
Methods included from PersistAssetsConcern
#asset_io, #replace_with_content_assets!, #replace_with_content_assets_in_hash!
Methods included from ToHashConcern
#prepare_value_for_hash, #to_hash
Constructor Details
#initialize(object, content_assets_pusher) ⇒ SectionDecorator
Returns a new instance of SectionDecorator.
11 12 13 14 |
# File 'lib/locomotive/wagon/decorators/section_decorator.rb', line 11 def initialize(object, content_assets_pusher) self.__content_assets_pusher__ = content_assets_pusher super(object, nil, nil) end |
Instance Attribute Details
#__content_assets_pusher__ ⇒ Object
Returns the value of attribute content_assets_pusher.
9 10 11 |
# File 'lib/locomotive/wagon/decorators/section_decorator.rb', line 9 def __content_assets_pusher__ @__content_assets_pusher__ end |
Instance Method Details
#__attributes__ ⇒ Object
16 17 18 |
# File 'lib/locomotive/wagon/decorators/section_decorator.rb', line 16 def __attributes__ %i(name slug template definition) end |
#definition ⇒ Object
28 29 30 |
# File 'lib/locomotive/wagon/decorators/section_decorator.rb', line 28 def definition replace_with_content_assets!(__getobj__.definition.to_json) end |
#id ⇒ Object
20 21 22 |
# File 'lib/locomotive/wagon/decorators/section_decorator.rb', line 20 def id slug end |
#template ⇒ Object
24 25 26 |
# File 'lib/locomotive/wagon/decorators/section_decorator.rb', line 24 def template replace_with_content_assets!(self.liquid_source) end |