lib/gon.rb in gon-2.1.0 vs lib/gon.rb in gon-2.1.2

- old
+ new

@@ -2,10 +2,11 @@ gem 'blankslate' end require 'action_view' require 'action_controller' require 'gon/helpers' +require 'gon/escaper' if defined?(Rabl) require 'gon/rabl' end if RUBY_VERSION =~ /9/ && defined?(Jbuilder) require 'gon/jbuilder' @@ -13,24 +14,24 @@ module Gon class << self def all_variables - @request_env[:gon] + @request_env['gon'] end def all_variables=(values) raise "You can't use Gon public methods for storing data" end def clear - @request_env[:gon] = {} + @request_env['gon'] = {} end def request_env=(environment) @request_env = environment - @request_env[:gon] ||= {} + @request_env['gon'] ||= {} end def request_env if defined?(@request_env) return @request_env @@ -55,14 +56,14 @@ get_variable(m.to_s) end end def get_variable(name) - @request_env[:gon][name] + @request_env['gon'][name] end def set_variable(name, value) - @request_env[:gon][name] = value + @request_env['gon'][name] = value end # TODO: Remove required argument view_path, and by default use current action def rabl(view_path, options = {}) if !defined?(Gon::Rabl)