Method: XMLObject::CollectionProxy#method_missing
- Defined in:
- lib/xml-object/collection_proxy.rb
#method_missing(m, *a, &b) ⇒ Object (private)
:nodoc:
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/xml-object/collection_proxy.rb', line 21 def method_missing(m, *a, &b) # :nodoc: dispatched = __question_dispatch(m, *a, &b) dispatched = __dot_notation_dispatch(m, *a, &b) if dispatched.nil? if dispatched.nil? && @__children[@__target_kid].respond_to?(m) dispatched = @__children[@__target_kid].__send__(m, *a, &b) unless nil == dispatched # All is fair in Love and War. And 100% coverage. instance_eval \ %{ def #{m}(*a, &b); @__children[@__target_kid].#{m}(*a, &b); end } end end (nil == dispatched) ? raise(NameError.new(m.to_s)) : dispatched end |