Method: JSONBuilder::Compiler#method_missing
- Defined in:
- lib/json_builder/compiler.rb
#method_missing(key_name, *args, &block) ⇒ Object
Public: Called anytime the compiler is passed JSON keys, first checks to see if the parent object contains the method like a Rails helper.
key_name - The key for the JSON member. args - An array of values passed to JSONBuilder::Value. block - Yielding any block passed to the element.
Returns nothing.
83 84 85 86 87 88 89 |
# File 'lib/json_builder/compiler.rb', line 83 def method_missing(key_name, *args, &block) if @_scope.respond_to?(key_name) && !ignore_scope_methods.include?(key_name) @_scope.send(key_name, *args, &block) else key(key_name, *args, &block) end end |