Class: Gon
- Inherits:
-
Object
- Object
- Gon
- Defined in:
- lib/json_dumper/patches/gon.rb
Overview
Monkey patching
Class Method Summary collapse
Class Method Details
.set_variable(name, value) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/json_dumper/patches/gon.rb', line 5 def set_variable(name, value) if value.is_a?(::JsonDumper::Delayed) value = Class.new.extend(::JsonDumper::Helper).dumper_fetch(value) elsif value.respond_to?(:each) value = ::JsonDumper::KeyTransformer.keys_to_camelcase(value) end current_gon.gon[::JsonDumper::KeyTransformer.camelize(name)] = value end |