Class: Surrogate::SurrogateInstanceReflector

Inherits:
Struct
  • Object
show all
Defined in:
lib/surrogate/surrogate_instance_reflector.rb

Overview

Utilities for reflecting on surrogate instances

Primarily it exists to avoid having to pollute the surrogate with reflection methods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#surrogateObject

Returns the value of attribute surrogate

Returns:

  • (Object)

    the current value of surrogate



6
7
8
# File 'lib/surrogate/surrogate_instance_reflector.rb', line 6

def surrogate
  @surrogate
end

Instance Method Details

#hatchlingObject



11
12
13
# File 'lib/surrogate/surrogate_instance_reflector.rb', line 11

def hatchling
  @hatchling ||= surrogate.instance_variable_get :@hatchling
end

#invocations(method_name) ⇒ Object



7
8
9
# File 'lib/surrogate/surrogate_instance_reflector.rb', line 7

def invocations(method_name)
  hatchling.invocations(method_name)
end