Class: Handlebarsjs::Javascript

Inherits:
Object
  • Object
show all
Defined in:
lib/handlebarsjs/javascript.rb

Overview

API for interacting with Javascript while providing native Ruby helpers

Direct Known Subclasses

Handlebars

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeJavascript

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_snapshotObject (readonly)

Returns the value of attribute handlebars_snapshot.



6
7
8
# File 'lib/handlebarsjs/javascript.rb', line 6

def handlebars_snapshot
  @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