Module: Hornetseye::MultiArrayConversion
- Defined in:
- lib/multiarray/shortcuts.rb
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/multiarray/shortcuts.rb', line 48 def method_missing( name, *args ) if name.to_s =~ /^to_[a-z]+$/ target = name.to_s[ 3 .. -1 ].upcase if Hornetseye.const_defined? target target = Hornetseye.const_get target if target.is_a? Class and target < Element to_type target, *args else super target, *args end else super name, *args end else super name, *args end end |