Class: Handlebarsjs::Javascript
- Inherits:
-
Object
- Object
- Handlebarsjs::Javascript
- Defined in:
- lib/handlebarsjs/javascript.rb
Overview
API for interacting with Javascript while providing native Ruby helpers
Direct Known Subclasses
Instance Attribute Summary collapse
-
#handlebars_snapshot ⇒ Object
readonly
Returns the value of attribute handlebars_snapshot.
Instance Method Summary collapse
- #attach(script, block) ⇒ Object
- #call(function_name, *arguments) ⇒ Object
- #eval(script) ⇒ Object
-
#initialize ⇒ Javascript
constructor
A new instance of Javascript.
Constructor Details
#initialize ⇒ Javascript
Returns a new instance of Javascript.
8 9 10 |
# File 'lib/handlebarsjs/javascript.rb', line 8 def initialize @handlebars_snapshot = HandlebarsSnapshot.new end |
Instance Attribute Details
#handlebars_snapshot ⇒ Object (readonly)
Returns the value of attribute handlebars_snapshot.
6 7 8 |
# File 'lib/handlebarsjs/javascript.rb', line 6 def @handlebars_snapshot end |
Instance Method Details
#attach(script, block) ⇒ Object
16 17 18 |
# File 'lib/handlebarsjs/javascript.rb', line 16 def attach(script, block) context.attach(script, block) end |
#call(function_name, *arguments) ⇒ Object
20 21 22 |
# File 'lib/handlebarsjs/javascript.rb', line 20 def call(function_name, *arguments) context.call(function_name, *arguments) end |
#eval(script) ⇒ Object
12 13 14 |
# File 'lib/handlebarsjs/javascript.rb', line 12 def eval(script) context.eval(script) end |