Module: Gon::Global
- Defined in:
- lib/gon/global.rb
Class Method Summary collapse
- .all_variables ⇒ Object
- .clear ⇒ Object
- .inspect ⇒ Object
- .jbuilder(*args) ⇒ Object
- .method_missing(method, *args, &block) ⇒ Object
- .rabl(*args) ⇒ Object
Class Method Details
.all_variables ⇒ Object
5 6 7 |
# File 'lib/gon/global.rb', line 5 def all_variables @global_vars || {} end |
.clear ⇒ Object
34 35 36 |
# File 'lib/gon/global.rb', line 34 def clear @global_vars = {} end |
.inspect ⇒ Object
38 39 40 |
# File 'lib/gon/global.rb', line 38 def inspect 'Gon' end |
.jbuilder(*args) ⇒ Object
28 29 30 31 32 |
# File 'lib/gon/global.rb', line 28 def jbuilder(*args) data, = Gon::Jbuilder.handler(args, true) store_builder_data 'jbuilder', data, end |
.method_missing(method, *args, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gon/global.rb', line 9 def method_missing(method, *args, &block) @global_vars ||= {} if ( method.to_s =~ /=$/ ) if public_method_name? method raise "You can't use Gon public methods for storing data" end @global_vars[method.to_s.delete('=')] = args[0] else @global_vars[method.to_s] end end |