Class: Tinybucket::Resource::Commits

Inherits:
Base
  • Object
show all
Defined in:
lib/tinybucket/resource/commits.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo, options) ⇒ Commits

Returns a new instance of Commits.



6
7
8
9
# File 'lib/tinybucket/resource/commits.rb', line 6

def initialize(repo, options)
  @repo = repo
  @args = [options]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Tinybucket::Resource::Base

Instance Method Details

#branch(name, options = {}) ⇒ Tinybucket::Iterator

Returns the commits for a specific branch

Parameters:

  • name (String)
  • options (Hash) (defaults to: {})

Returns:



27
28
29
30
31
# File 'lib/tinybucket/resource/commits.rb', line 27

def branch(name, options = {})
  create_enumerator(commits_api, :branch, name, options) do |m|
    inject_repo_keys(m, @repo.repo_keys)
  end
end

#find(revision, options = {}) ⇒ Tinybucket::Model::Commit

Find the commit

Parameters:

  • revision (String)
  • options (Hash) (defaults to: {})

Returns:



16
17
18
19
20
# File 'lib/tinybucket/resource/commits.rb', line 16

def find(revision, options = {})
  commits_api.find(revision, options).tap do |m|
    inject_repo_keys(m, @repo.repo_keys)
  end
end