Parent

Gon

Constants

VERSION

Public Class Methods

all_variables() click to toggle source
# File lib/gon.rb, line 65
def all_variables
  current_gon ? current_gon.gon : {}
end
clear() click to toggle source
# File lib/gon.rb, line 69
def clear
  current_gon.clear if current_gon
end
get_variable(name) click to toggle source
# File lib/gon.rb, line 49
def get_variable(name)
  current_gon.gon[name]
end
global() click to toggle source
# File lib/gon.rb, line 26
def global
  Gon::Global
end
inspect() click to toggle source
# File lib/gon.rb, line 84
def inspect
  'Gon'
end
jbuilder(*args) click to toggle source
# 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
method_missing(method, *args, &block) click to toggle source
# 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
push(data = {}) click to toggle source
# 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
rabl(*args) click to toggle source
# File lib/gon.rb, line 73
def rabl(*args)
  data, options = Gon::Rabl.handler(args)
  store_builder_data 'rabl', data, options
end
set_variable(name, value) click to toggle source
# File lib/gon.rb, line 53
def set_variable(name, value)
  current_gon.gon[name] = value
end
watch() click to toggle source
# File lib/gon.rb, line 30
def watch
  Gon::Watch
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.