Module: Hornetseye::FrameConversion

Defined in:
docs/hornetseye-frame/lib/hornetseye-frame/shortcuts.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'docs/hornetseye-frame/lib/hornetseye-frame/shortcuts.rb', line 46

def method_missing( name, *args )
  if name.to_s =~ /^to_[a-z0-9]+$/
    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 ) or target.is_a? FourCC
        to_type target, *args
      else
        super target, *args
      end
    else
      super name, *args
    end
  else
    super name, *args
  end
end