Sha256: 05171ee837e4c373e01a88bd35454d884a776ead7eafa05230955593ccbd3711

Contents?: true

Size: 591 Bytes

Versions: 23

Compression:

Stored size: 591 Bytes

Contents

module Dugway
  module Drops
    class ThemeDrop < BaseDrop
      def before_method(method_or_key)
        if source.respond_to?('has_key?') && source.has_key?(method_or_key) && images.find { |image| image['variable'] == method_or_key.to_s }
          return ImageDrop.new(source[method_or_key].stringify_keys)
        end
        
        super
      end
      
      private
      
      def images
        @images ||= settings.has_key?('images') ? settings['images'] : []
      end
      
      def settings
        @settings ||= @context.registers[:settings]
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
dugway-0.8.3 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.8.2 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.8.1 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.8.0 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.7.1 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.7.0 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.6.7 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.6.6 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.6.5 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.6.4 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.6.3 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.6.2 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.6.1 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.6.0 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.5.9 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.5.8 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.5.7 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.5.6 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.5.4 lib/dugway/liquid/drops/theme_drop.rb
dugway-0.5.3 lib/dugway/liquid/drops/theme_drop.rb