Module: Hamlbars::Ext::Closure

Included in:
Template
Defined in:
lib/hamlbars/ext/closure.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) included(base)



5
6
7
# File 'lib/hamlbars/ext/closure.rb', line 5

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

- (Object) evaluate_with_closure(scope, locals, &block)

Wraps the JavaScript generated by Haml::Template#evaluate in a JavaScript closure.



11
12
13
# File 'lib/hamlbars/ext/closure.rb', line 11

def evaluate_with_closure(scope, locals, &block)
  self.class.closures_enabled? ? enclosify { evaluate_without_closure(scope,locals,&block) } : evaluate_without_closure(scope,locals,&block)
end