lib/gon.rb in gon-4.0.0 vs lib/gon.rb in gon-4.0.1
- old
+ new
@@ -1,8 +1,5 @@
-if defined?(Jbuilder)
- gem 'blankslate'
-end
require 'action_view'
require 'action_controller'
require 'gon/base'
require 'gon/global'
require 'gon/watch'
@@ -37,10 +34,18 @@
else
get_variable(method.to_s)
end
end
+ def get_variable(name)
+ Request.gon[name]
+ end
+
+ def set_variable(name, value)
+ Request.gon[name] = value
+ end
+
def all_variables
Request.gon
end
def clear
@@ -68,17 +73,9 @@
def inspect
'Gon'
end
private
-
- def get_variable(name)
- Request.gon[name]
- end
-
- def set_variable(name, value)
- Request.gon[name] = value
- end
def store_builder_data(builder, data, options)
if options[:as]
set_variable(options[:as].to_s, data)
elsif data.is_a? Hash