Class: Dugway::Drops::ThemeImageSetsDrop

Inherits:
BaseDrop
  • Object
show all
Defined in:
lib/dugway/liquid/drops/theme_image_sets_drop.rb

Instance Attribute Summary

Attributes inherited from BaseDrop

#params, #request, #source

Instance Method Summary collapse

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
# File 'lib/dugway/liquid/drops/theme_image_sets_drop.rb', line 4

def before_method(method_or_key)
  if source.respond_to?('has_key?') && source.has_key?(method_or_key) && settings_image_sets.find { |image| image['variable'] == method_or_key.to_s }
    source[method_or_key].map { |image| ImageDrop.new(image.stringify_keys) }
  else
    []
  end
end