class MethodLog::MethodCommit
Attributes
commit[R]
method_definition[R]
Public Class Methods
new(commit, method_definition)
click to toggle source
# File lib/method_log/method_commit.rb, line 5 def initialize(commit, method_definition) @commit = commit @method_definition = method_definition end
Public Instance Methods
==(other)
click to toggle source
# File lib/method_log/method_commit.rb, line 14 def ==(other) (commit == other.commit) && (method_definition == other.method_definition) end
hash()
click to toggle source
# File lib/method_log/method_commit.rb, line 18 def hash [commit, method_definition].hash end
message()
click to toggle source
# File lib/method_log/method_commit.rb, line 30 def message commit.message end
method_source()
click to toggle source
# File lib/method_log/method_commit.rb, line 34 def method_source method_definition && method_definition.source + $/ end
sha()
click to toggle source
# File lib/method_log/method_commit.rb, line 22 def sha commit.sha end
source_file()
click to toggle source
# File lib/method_log/method_commit.rb, line 38 def source_file method_definition && method_definition.source_file end
to_s()
click to toggle source
# File lib/method_log/method_commit.rb, line 42 def to_s [ "commit #{sha}", "Author: #{author[:name]} <#{author[:email]}>", "Date: #{author[:time].strftime('%a %b %-e %T %Y %z')}", '', message ].join($/) end
update(commit)
click to toggle source
# File lib/method_log/method_commit.rb, line 10 def update(commit) @commit = commit end