Method: Gon.method_missing
- Defined in:
- lib/gon.rb
.method_missing(m, *args, &block) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gon.rb', line 27 def method_missing(m, *args, &block) if ( m.to_s =~ /=$/ ) if public_methods.include? m.to_s[0..-2].to_sym raise "You can't use Gon public methods for storing data" end set_variable(m.to_s.delete('='), args[0]) else get_variable(m.to_s) end end |