Class: Tinybucket::Resource::Commit::BuildStatuses

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Tinybucket::Resource::Commit::Base

Dynamic Method Handling

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

Instance Method Details

#create(key, options) ⇒ Tinybucket::Model::BuildStatus

Create a build status for the commit

Parameters:

  • key (String)
  • options (Hash)

Returns:


29
30
31
32
33
34
# File 'lib/tinybucket/resource/commit/build_statuses.rb', line 29

def create(key, options)
  build_status_api.post(@commit.hash, key, options).tap do |m|
    m.revision = @commit.hash
    m.repo_keys = @commit.repo_keys
  end
end

#find(key, options = {}) ⇒ Tinybucket::Model::BuildStatus

Get the build status for the commit

Parameters:

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

Options Hash (options):

  • :state (String)
  • :key (String)
  • :name (String)
  • :url (String)
  • :description (String)

Returns:


17
18
19
20
21
22
# File 'lib/tinybucket/resource/commit/build_statuses.rb', line 17

def find(key, options = {})
  build_status_api.find(@commit.hash, key, options).tap do |m|
    m.revision = @commit.hash
    m.repo_keys = @commit.repo_keys
  end
end