Class: Spy::RegistryEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/spy/registry_entry.rb

Overview

Isolates the format we serialize spies in when we track them

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



3
4
5
# File 'lib/spy/registry_entry.rb', line 3

def method
  @method
end

#spiedObject

Returns the value of attribute spied

Returns:

  • (Object)

    the current value of spied



3
4
5
# File 'lib/spy/registry_entry.rb', line 3

def spied
  @spied
end

#spyObject

Returns the value of attribute spy

Returns:

  • (Object)

    the current value of spy



3
4
5
# File 'lib/spy/registry_entry.rb', line 3

def spy
  @spy
end

Instance Method Details

#==(other) ⇒ Object



9
10
11
# File 'lib/spy/registry_entry.rb', line 9

def ==(other)
  key == other.key
end

#keyObject



4
5
6
7
# File 'lib/spy/registry_entry.rb', line 4

def key
  receiver = method.is_a?(Method) ? method.receiver : nil
  "#{receiver.object_id}|#{method.name}|#{method.class}"
end