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
30 31 32 |
# File 'lib/git/log.rb', line 30 def commits @commits end |
Instance Method Details
#[](index) ⇒ Git::Object::Commit, ...
Returns a commit by index or a slice of commits by range
68 |
# File 'lib/git/log.rb', line 68 def [](index) = commits[index] |
#each ⇒ Enumerator<Git::Object::Commit> #each {|commit| ... } ⇒ Array<Git::Object::Commit>
Iterates over each commit in query order
53 |
# File 'lib/git/log.rb', line 53 def each(&block) = commits.each(&block) |
#last ⇒ Git::Object::Commit?
Returns the last commit in the result
59 |
# File 'lib/git/log.rb', line 59 def last = commits.last |
#size ⇒ Integer
Returns the number of commits in the result
80 |
# File 'lib/git/log.rb', line 80 def size = commits.size |
#to_s ⇒ String
Returns the commits joined with newlines
74 |
# File 'lib/git/log.rb', line 74 def to_s = commits.join("\n") |