class Tinybucket::Resource::BranchRestrictions

Public Class Methods

new(repo, options) click to toggle source

Constructor

@param repo [Tinybucket::Model::Repository] @param options [Hash]

# File lib/tinybucket/resource/branch_restrictions.rb, line 10
def initialize(repo, options)
  @repo = repo
  @args = [options]
end

Public Instance Methods

create(_options) click to toggle source

Create new BranchRestriction on the repository.

@param _options [Hash] @return [Tinybucket::Model::BranchRestriction]

# File lib/tinybucket/resource/branch_restrictions.rb, line 19
def create(_options)
  raise NotImplementedError
end
find(restriction_id, options = {}) click to toggle source

Find the BranchRestriction on the repository.

@param restriction_id [String] @param options [Hash] @return [Tinybucket::Model::BranchRestriction]

# 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

Private Instance Methods

enumerator() click to toggle source
# File lib/tinybucket/resource/branch_restrictions.rb, line 40
def enumerator
  create_enumerator(restrictions_api, :list, *@args) do |m|
    inject_repo_keys(m, @repo.repo_keys)
  end
end
restrictions_api() click to toggle source
# File lib/tinybucket/resource/branch_restrictions.rb, line 36
def restrictions_api
  create_api('BranchRestrictions', @repo.repo_keys)
end