Class: Memorb::MethodIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/memorb/method_identifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(method_name) ⇒ MethodIdentifier

Returns a new instance of MethodIdentifier.



6
7
8
# File 'lib/memorb/method_identifier.rb', line 6

def initialize(method_name)
  @method_name = method_name.to_sym
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



14
15
16
# File 'lib/memorb/method_identifier.rb', line 14

def ==(other)
  hash === other.hash
end

#hashObject



10
11
12
# File 'lib/memorb/method_identifier.rb', line 10

def hash
  self.class.hash ^ method_name.hash
end

#to_sObject



20
21
22
# File 'lib/memorb/method_identifier.rb', line 20

def to_s
  method_name.to_s
end

#to_symObject



24
25
26
# File 'lib/memorb/method_identifier.rb', line 24

def to_sym
  method_name
end