Method: ODBA::DRbWrapper#method_missing
- Defined in:
- lib/odba/drbwrapper.rb
#method_missing(sym, *args) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/odba/drbwrapper.rb', line 21 def method_missing(sym, *args) if(block_given?) res = @obj.__send__(sym, *args) { |*block_args| yield *block_args.collect { |arg| __wrap(arg) } } __wrap(res) else res = @obj.__send__(sym, *args) if(res.is_a?(Array)) res.collect { |item| __wrap(item) } elsif(res.is_a?(Hash)) res.inject({}) { |memo, (key, value)| memo.store(__wrap(key), __wrap(value)) memo } else __wrap(res) end end end |