Class: Gon::Watch

Inherits:
Gon
  • Object
show all
Defined in:
lib/gon/watch.rb

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_variablesObject



11
12
13
# File 'lib/gon/watch.rb', line 11

def all_variables
  @watch_variables || {}
end

.clearObject



15
16
17
# File 'lib/gon/watch.rb', line 15

def clear
  @watch_variables = {}
end

.renderObject



7
8
9
# File 'lib/gon/watch.rb', line 7

def render
  JS_FUNCTION + "window.gon.watchedVariables=#{all_variables.to_json};"
end