Class: Dugway::Drops::ThemeDrop

Inherits:
BaseDrop
  • Object
show all
Defined in:
lib/dugway/liquid/drops/theme_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
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_setsObject



19
20
21
# File 'lib/dugway/liquid/drops/theme_drop.rb', line 19

def image_sets
  Drops::ThemeImageSetsDrop.new(source)
end

#imagesObject

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