Class: Spritely::Sprockets::Transformer
- Inherits:
-
Struct
- Object
- Struct
- Spritely::Sprockets::Transformer
- Defined in:
- lib/spritely/sprockets/transformer.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
Returns the value of attribute input.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#input ⇒ Object
Returns the value of attribute input
6 7 8 |
# File 'lib/spritely/sprockets/transformer.rb', line 6 def input @input end |
Class Method Details
.cache_key ⇒ Object
11 12 13 |
# File 'lib/spritely/sprockets/transformer.rb', line 11 def self.cache_key @cache_key ||= "#{name}:#{Spritely::VERSION}".freeze end |
.call(input) ⇒ Object
7 8 9 |
# File 'lib/spritely/sprockets/transformer.rb', line 7 def self.call(input) new(input).call end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/spritely/sprockets/transformer.rb', line 15 def call data = cache.fetch([self.class.cache_key, input[:name], sprite_map.cache_key]) do sprite_map.files.each do |file| context.depend_on(File.dirname(file)) context.link_asset(file) end sprite_map.save! end context..merge(data: data) end |