Class: MethodLog::MethodCommit
- Inherits:
-
Object
- Object
- MethodLog::MethodCommit
- Defined in:
- lib/method_log/method_commit.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(commit: nil, method_definition: nil) ⇒ MethodCommit
constructor
A new instance of MethodCommit.
- #to_s ⇒ Object
Constructor Details
#initialize(commit: nil, method_definition: nil) ⇒ MethodCommit
Returns a new instance of MethodCommit.
3 4 5 6 |
# File 'lib/method_log/method_commit.rb', line 3 def initialize(commit: nil, method_definition: nil) @commit = commit @method_definition = method_definition end |
Instance Method Details
#==(other) ⇒ Object
8 9 10 |
# File 'lib/method_log/method_commit.rb', line 8 def ==(other) (commit == other.commit) && (method_definition == other.method_definition) end |
#hash ⇒ Object
12 13 14 |
# File 'lib/method_log/method_commit.rb', line 12 def hash [commit, method_definition].hash end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/method_log/method_commit.rb', line 16 def to_s "#{commit}: #{method_definition}" end |