Class: Memorb::MethodIdentifier
- Inherits:
-
Object
- Object
- Memorb::MethodIdentifier
- Defined in:
- lib/memorb/method_identifier.rb
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(method_name) ⇒ MethodIdentifier
constructor
A new instance of MethodIdentifier.
- #to_s ⇒ Object
- #to_sym ⇒ Object
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 |
#hash ⇒ Object
10 11 12 |
# File 'lib/memorb/method_identifier.rb', line 10 def hash self.class.hash ^ method_name.hash end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/memorb/method_identifier.rb', line 20 def to_s method_name.to_s end |
#to_sym ⇒ Object
24 25 26 |
# File 'lib/memorb/method_identifier.rb', line 24 def to_sym method_name end |