Class: GitReporting::Commit
- Inherits:
-
Object
- Object
- GitReporting::Commit
- Defined in:
- lib/git_reporting/commit.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#message ⇒ Object
Returns the value of attribute message.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#time ⇒ Object
Returns the value of attribute time.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Commit
constructor
A new instance of Commit.
- #to_s ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Commit
Returns a new instance of Commit.
8 9 10 11 12 13 |
# File 'lib/git_reporting/commit.rb', line 8 def initialize(attrs = {}) @time = 0 attrs.each do |key, value| send "#{key}=", value end end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
6 7 8 |
# File 'lib/git_reporting/commit.rb', line 6 def @author end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/git_reporting/commit.rb', line 6 def @message end |
#sha ⇒ Object
Returns the value of attribute sha.
6 7 8 |
# File 'lib/git_reporting/commit.rb', line 6 def sha @sha end |
#time ⇒ Object
Returns the value of attribute time.
6 7 8 |
# File 'lib/git_reporting/commit.rb', line 6 def time @time end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
6 7 8 |
# File 'lib/git_reporting/commit.rb', line 6 def @timestamp end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/git_reporting/commit.rb', line 21 def to_s "Commit #{sha}" end |