Class: RiotJs::Rails::SprocketsProcessor

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/riot_js/rails/processors/sprockets_processor_v2.rb,
lib/riot_js/rails/processors/sprockets_processor_v3.rb

Direct Known Subclasses

Processor

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(input) ⇒ Object



8
9
10
# File 'lib/riot_js/rails/processors/sprockets_processor_v3.rb', line 8

def self.call(input)
  instance.call(input)
end

.instanceObject



4
5
6
# File 'lib/riot_js/rails/processors/sprockets_processor_v3.rb', line 4

def self.instance
  @instance ||= new
end

.register_self(config) ⇒ Object



7
8
9
# File 'lib/riot_js/rails/processors/sprockets_processor_v2.rb', line 7

def self.register_self(app)
  app.assets.register_engine '.tag', self
end

Instance Method Details

#call(input) ⇒ Object



12
13
14
15
16
17
# File 'lib/riot_js/rails/processors/sprockets_processor_v3.rb', line 12

def call(input)
  prepare(input)
  data = process

  @context..merge(data: data)
end

#evaluate(context, locals, &block) ⇒ Object



11
12
13
14
# File 'lib/riot_js/rails/processors/sprockets_processor_v2.rb', line 11

def evaluate(context, locals, &block)
  @context = context
  process
end