Class: Tinybucket::Resource::BranchRestrictions

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

Instance Method Summary collapse

Constructor Details

#initialize(repo, options) ⇒ BranchRestrictions

Constructor

Parameters:



10
11
12
13
# File 'lib/tinybucket/resource/branch_restrictions.rb', line 10

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

#create(_options) ⇒ Tinybucket::Model::BranchRestriction

Create new BranchRestriction on the repository.

Parameters:

  • _options (Hash)

Returns:

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/tinybucket/resource/branch_restrictions.rb', line 19

def create(_options)
  raise NotImplementedError
end

#find(restriction_id, options = {}) ⇒ Tinybucket::Model::BranchRestriction

Find the BranchRestriction on the repository.

Parameters:

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

Returns:



28
29
30
31
32
# File 'lib/tinybucket/resource/branch_restrictions.rb', line 28

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