Class: InstanceReflection

Inherits:
ObjectReflection show all
Defined in:
lib/more/facets/reflection.rb

Constant Summary collapse

REFLECTION_METHODS =
[
  :send
] + Kernel.instance_methods.select{ |m| m =~ /^instance_/ }

Instance Method Summary collapse

Methods inherited from ObjectReflection

#id

Constructor Details

#initialize(object) ⇒ InstanceReflection

Returns a new instance of InstanceReflection.



73
74
75
76
77
78
79
# File 'lib/more/facets/reflection.rb', line 73

def initialize(object)
  @self = object
  @meta = REFLECTION_METHODS.inject({}) do |rproc, meth|
    rproc[meth.to_sym] = Kernel.instance_method(meth).bind(@self)
    rproc
  end
end