Class: Git::Log::Result
- Inherits:
-
Data
- Object
- Data
- Git::Log::Result
- Includes:
- Enumerable
- Defined in:
- lib/git/log.rb
Overview
An immutable, Enumerable collection of Git::Object::Commit objects.
Returned by Git::Log#execute.
Instance Attribute Summary collapse
-
#commits ⇒ Object
readonly
Returns the value of attribute commits.
Instance Method Summary collapse
-
#[](index) ⇒ Git::Object::Commit, ...
Returns a commit by index or a slice of commits by range.
-
#each(&block)
Iterates over each commit in query order.
-
#last ⇒ Git::Object::Commit?
Returns the last commit in the result.
-
#size ⇒ Integer
Returns the number of commits in the result.
-
#to_s ⇒ String
Returns the commits joined with newlines.
Instance Attribute Details
#commits ⇒ Object (readonly)
Returns the value of attribute commits
28 29 30 |
# File 'lib/git/log.rb', line 28 def commits @commits end |
Instance Method Details
#[](index) ⇒ Git::Object::Commit, ...
Returns a commit by index or a slice of commits by range
66 |
# File 'lib/git/log.rb', line 66 def [](index) = commits[index] |
#each ⇒ Enumerator<Git::Object::Commit> #each {|commit| ... } ⇒ Array<Git::Object::Commit>
Iterates over each commit in query order
51 |
# File 'lib/git/log.rb', line 51 def each(&block) = commits.each(&block) |
#last ⇒ Git::Object::Commit?
Returns the last commit in the result
57 |
# File 'lib/git/log.rb', line 57 def last = commits.last |
#size ⇒ Integer
Returns the number of commits in the result
78 |
# File 'lib/git/log.rb', line 78 def size = commits.size |
#to_s ⇒ String
Returns the commits joined with newlines
72 |
# File 'lib/git/log.rb', line 72 def to_s = commits.join("\n") |