Class: Gon::Watch
Constant Summary
collapse
- JS_FUNCTION =
File.read(File.expand_path('../../../js/watch.js', __FILE__))
Constants inherited
from Gon
VERSION
Class Method Summary
collapse
Methods inherited from Gon
get_variable, global, inspect, jbuilder, method_missing, push, rabl, watch
Class Method Details
.all_variables ⇒ Object
11
12
13
|
# File 'lib/gon/watch.rb', line 11
def all_variables
@watch_variables || {}
end
|
.clear ⇒ Object
15
16
17
|
# File 'lib/gon/watch.rb', line 15
def clear
@watch_variables = {}
end
|
.render ⇒ Object
7
8
9
|
# File 'lib/gon/watch.rb', line 7
def render
JS_FUNCTION + "window.gon.watchedVariables=#{all_variables.to_json};"
end
|