Class: GitReport::Log
- Inherits:
-
Object
- Object
- GitReport::Log
- Defined in:
- lib/log.rb
Instance Attribute Summary collapse
-
#commits ⇒ Object
returns all the commits of that project of the currently checked out branch.
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
-
#first ⇒ Object
returns the initial commit.
-
#initialize(project = nil) ⇒ Log
constructor
A new instance of Log.
-
#last ⇒ Object
returns the most recent commit.
Constructor Details
#initialize(project = nil) ⇒ Log
Returns a new instance of Log.
6 7 8 9 |
# File 'lib/log.rb', line 6 def initialize project = nil raise 'No git repo found!' unless project @project = project end |
Instance Attribute Details
#commits ⇒ Object
returns all the commits of that project of the currently checked out branch
12 13 14 |
# File 'lib/log.rb', line 12 def commits @commits end |
#project ⇒ Object
Returns the value of attribute project.
4 5 6 |
# File 'lib/log.rb', line 4 def project @project end |
Instance Method Details
#first ⇒ Object
returns the initial commit
22 23 24 |
# File 'lib/log.rb', line 22 def first @@first ||= self.commits.first end |
#last ⇒ Object
returns the most recent commit
17 18 19 |
# File 'lib/log.rb', line 17 def last @@last ||= self.commits.last end |