Object
# File lib/gon.rb, line 65 def all_variables current_gon ? current_gon.gon : {} end
# File lib/gon.rb, line 69 def clear current_gon.clear if current_gon end
# File lib/gon.rb, line 49 def get_variable(name) current_gon.gon[name] end
# File lib/gon.rb, line 78 def jbuilder(*args) ensure_template_handler_is_defined data, options = Gon::Jbuilder.handler(args) store_builder_data 'jbuilder', data, options end
# File lib/gon.rb, line 34 def method_missing(method, *args, &block) if method.to_s =~ /=$/ if public_method_name?(method) raise 'You can\t use Gon public methods for storing data' end if self == Gon && !current_gon raise 'Assign request-specific gon variables only through `gon` helper, not through Gon constant' end set_variable(method.to_s.delete('='), args[0]) else get_variable(method.to_s) end end
# File lib/gon.rb, line 57 def push(data = {}) raise 'Object must have each_pair method' unless data.respond_to? :each_pair data.each_pair do |name, value| set_variable(name.to_s, value) end end
# File lib/gon.rb, line 73 def rabl(*args) data, options = Gon::Rabl.handler(args) store_builder_data 'rabl', data, options end
Generated with the Darkfish Rdoc Generator 2.