Class: Dugway::Drops::ThemeDrop
- Defined in:
- lib/dugway/liquid/drops/theme_drop.rb
Instance Attribute Summary
Attributes inherited from BaseDrop
Instance Method Summary collapse
- #before_method(method_or_key) ⇒ Object
- #image_sets ⇒ Object
-
#images ⇒ Object
Newer API for theme images.
Methods inherited from BaseDrop
#cart, #context=, #error, #errors, #initialize, #method_missing, #store, #theme
Constructor Details
This class inherits a constructor from Dugway::Drops::BaseDrop
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Dugway::Drops::BaseDrop
Instance Method Details
#before_method(method_or_key) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/dugway/liquid/drops/theme_drop.rb', line 4 def before_method(method_or_key) # We should try to get away from this api and use the newer one below if source.respond_to?('has_key?') && source.has_key?(method_or_key) && settings_images.find { |image| image['variable'] == method_or_key.to_s } return ImageDrop.new(source[method_or_key].stringify_keys) end super end |
#image_sets ⇒ Object
19 20 21 |
# File 'lib/dugway/liquid/drops/theme_drop.rb', line 19 def image_sets Drops::ThemeImageSetsDrop.new(source) end |
#images ⇒ Object
Newer API for theme images. theme.images.logo
15 16 17 |
# File 'lib/dugway/liquid/drops/theme_drop.rb', line 15 def images Drops::ThemeImagesDrop.new(source) end |