Class: MethodLog::MethodCommit

Inherits:
Object
  • Object
show all
Defined in:
lib/method_log/method_commit.rb

Instance Method Summary collapse

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

#hashObject



12
13
14
# File 'lib/method_log/method_commit.rb', line 12

def hash
  [commit, method_definition].hash
end

#to_sObject



16
17
18
# File 'lib/method_log/method_commit.rb', line 16

def to_s
  "#{commit}: #{method_definition}"
end