Class: Handlebars::Engine::Function
- Inherits:
-
Object
- Object
- Handlebars::Engine::Function
- Defined in:
- lib/handlebars/engine/function.rb
Overview
A proxy for a JavaScript function defined in the context.
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(context, name) ⇒ Function
constructor
A new instance of Function.
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 |