Class: Handlebars::Engine::Function

Inherits:
Object
  • Object
show all
Defined in:
lib/handlebars/engine/function.rb

Overview

A proxy for a JavaScript function defined in the context.

Instance Method Summary collapse

Constructor Details

#initialize(context, name) ⇒ Function

Returns a new instance of Function.



7
8
9
10
# File 'lib/handlebars/engine/function.rb', line 7

def initialize(context, name)
  @context = context
  @name = name
end

Instance Method Details

#call(*args) ⇒ Object



12
13
14
# File 'lib/handlebars/engine/function.rb', line 12

def call(*args)
  @context.call(@name, *args)
end