Class: GitHooks::GitAdapter::Commits
- Inherits:
-
Object
- Object
- GitHooks::GitAdapter::Commits
- Includes:
- Enumerable
- Defined in:
- lib/git_hooks/git_adapter.rb
Instance Attribute Summary collapse
-
#ref_name ⇒ Object
readonly
Returns the value of attribute ref_name.
-
#repo_name ⇒ Object
readonly
Returns the value of attribute repo_name.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(commits, ref_name, repo) ⇒ Commits
constructor
A new instance of Commits.
- #size ⇒ Object
Constructor Details
#initialize(commits, ref_name, repo) ⇒ Commits
Returns a new instance of Commits.
12 13 14 15 16 |
# File 'lib/git_hooks/git_adapter.rb', line 12 def initialize(commits, ref_name, repo) @commits = commits self.ref_name = ref_name self.repo_name = repo end |
Instance Attribute Details
#ref_name ⇒ Object
Returns the value of attribute ref_name.
10 11 12 |
# File 'lib/git_hooks/git_adapter.rb', line 10 def ref_name @ref_name end |
#repo_name ⇒ Object
Returns the value of attribute repo_name.
10 11 12 |
# File 'lib/git_hooks/git_adapter.rb', line 10 def repo_name @repo_name end |
Instance Method Details
#each ⇒ Object
18 19 20 |
# File 'lib/git_hooks/git_adapter.rb', line 18 def each @commits.each { |commit| yield commit } end |
#size ⇒ Object
22 23 24 |
# File 'lib/git_hooks/git_adapter.rb', line 22 def size @commits.size end |