Class: JqueryExpandAssets::JqueryExpandProcessor

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/jquery_expand_assets/jquery_expand_processor.rb

Instance Method Summary collapse

Instance Method Details

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



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/jquery_expand_assets/jquery_expand_processor.rb', line 8

def evaluate(scope, locals, &block)
  name = scope.logical_path.sub(/^templates\//, '').sub(%r{/?_?([^/]*)$}, '/\1')
  <<-COFFEE
    this.JST ||= {}
    template = null
    html = """
           #{data}
           """
    this.JST[#{name.inspect}] = (directive) ->
      template ||= $($.parseHTML(html)).filter('*')
      template.expand(directive).children()
  COFFEE
end

#prepareObject

implemented for the superclass’s template method



6
# File 'lib/jquery_expand_assets/jquery_expand_processor.rb', line 6

def prepare; end