Class: Elm::Rails::Sprockets
- Inherits:
-
Object
- Object
- Elm::Rails::Sprockets
- Defined in:
- lib/elm/rails/sprockets.rb
Constant Summary collapse
- VERSION =
'3'
Instance Attribute Summary collapse
-
#cache_key ⇒ Object
readonly
Returns the value of attribute cache_key.
Class Method Summary collapse
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize(options = {}) ⇒ Sprockets
constructor
A new instance of Sprockets.
Constructor Details
Instance Attribute Details
#cache_key ⇒ Object (readonly)
Returns the value of attribute cache_key.
20 21 22 |
# File 'lib/elm/rails/sprockets.rb', line 20 def cache_key @cache_key end |
Class Method Details
.cache_key ⇒ Object
16 17 18 |
# File 'lib/elm/rails/sprockets.rb', line 16 def self.cache_key instance.cache_key end |
.call(input) ⇒ Object
12 13 14 |
# File 'lib/elm/rails/sprockets.rb', line 12 def self.call(input) instance.call(input) end |
.instance ⇒ Object
8 9 10 |
# File 'lib/elm/rails/sprockets.rb', line 8 def self.instance @instance ||= new end |
Instance Method Details
#call(input) ⇒ Object
26 27 28 29 30 |
# File 'lib/elm/rails/sprockets.rb', line 26 def call(input) context = input[:environment].context_class.new(input) add_elm_dependencies(input[:filename], input[:load_path], context) context..merge(data: Elm::Compiler.compile(input[:filename])) end |