Module: Kernel

Defined in:
lib/java.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



27
28
29
30
31
# File 'lib/java.rb', line 27

def method_missing(meth, *args, &block)
  [Object.const_get(meth), args, block]
rescue NameError
  super
end

Instance Method Details

#new(klass) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/java.rb', line 19

def new(klass)
  if Array === klass
    klass[0].send(:new, *klass[1], &klass[2])
  else
    klass
  end
end