Class: Exo::ResourceDecorator
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- Exo::ResourceDecorator
- Defined in:
- app/presenters/exo/resource_decorator.rb
Instance Method Summary collapse
- #item_name(slug_id) ⇒ Object
- #items ⇒ Object
- #meta_field_name(name) ⇒ Object
- #wrap_item(item) ⇒ Object
Instance Method Details
#item_name(slug_id) ⇒ Object
9 10 11 |
# File 'app/presenters/exo/resource_decorator.rb', line 9 def item_name slug_id wrap_item items.find_by(slug_id: slug_id) end |
#items ⇒ Object
5 6 7 |
# File 'app/presenters/exo/resource_decorator.rb', line 5 def items ScopeWraper.new resource.items, self end |
#meta_field_name(name) ⇒ Object
13 14 15 |
# File 'app/presenters/exo/resource_decorator.rb', line 13 def name resource..where(slug_id: name.to_s).first end |
#wrap_item(item) ⇒ Object
17 18 19 |
# File 'app/presenters/exo/resource_decorator.rb', line 17 def wrap_item item ItemDecorator.new item if item end |