Class: ObjectSpace::Reflector

Inherits:
Object
  • Object
show all
Defined in:
lib/core/facets/objectspace/reflect.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ Reflector

Returns a new instance of Reflector.



43
44
45
# File 'lib/core/facets/objectspace/reflect.rb', line 43

def initialize(obj)
  @obj = obj
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(op, *args, &yld) ⇒ Object



47
48
49
# File 'lib/core/facets/objectspace/reflect.rb', line 47

def method_missing(op, *args, &yld)
  Kernel.instance_method(op).bind(@obj).call(*args, &yld)
end