Class: Sprockets::MustacheJsTemplate

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/mustache-trimmer-rails.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/mustache-trimmer-rails.rb', line 9

def self.engine_initialized?
  defined? ::Mustache.to_javascript
end

Instance Method Details

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



20
21
22
# File 'lib/mustache-trimmer-rails.rb', line 20

def evaluate(scope, locals, &block)
  Mustache.to_javascript(data)
end

#initialize_engineObject



13
14
15
# File 'lib/mustache-trimmer-rails.rb', line 13

def initialize_engine
  require_template_library 'mustache/js'
end

#prepareObject



17
18
# File 'lib/mustache-trimmer-rails.rb', line 17

def prepare
end