Class: Tinybucket::Model::Branch

Inherits:
Base
  • Object
show all
Includes:
Concerns::RepositoryKeys
Defined in:
lib/tinybucket/model/branch.rb

Overview

Branch

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attributes, #attributes=, concern_included?, #initialize

Constructor Details

This class inherits a constructor from Tinybucket::Model::Base

Instance Attribute Details

Returns:

  • (Hash)

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/tinybucket/model/branch.rb', line 20

class Branch < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes :links, :type, :name, :repository, :target

  # Returns the commits available for the specific branch
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource.branch(name, options)
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def branches_api
    create_api('Branches', repo_keys)
  end

  def load_model
    branches_api.find(name, {})
  end
end

#nameString

Returns:

  • (String)

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/tinybucket/model/branch.rb', line 20

class Branch < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes :links, :type, :name, :repository, :target

  # Returns the commits available for the specific branch
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource.branch(name, options)
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def branches_api
    create_api('Branches', repo_keys)
  end

  def load_model
    branches_api.find(name, {})
  end
end

#repositoryHash

Returns:

  • (Hash)

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/tinybucket/model/branch.rb', line 20

class Branch < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes :links, :type, :name, :repository, :target

  # Returns the commits available for the specific branch
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource.branch(name, options)
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def branches_api
    create_api('Branches', repo_keys)
  end

  def load_model
    branches_api.find(name, {})
  end
end

#targetHash

Returns:

  • (Hash)

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/tinybucket/model/branch.rb', line 20

class Branch < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes :links, :type, :name, :repository, :target

  # Returns the commits available for the specific branch
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource.branch(name, options)
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def branches_api
    create_api('Branches', repo_keys)
  end

  def load_model
    branches_api.find(name, {})
  end
end

#typeString

Returns:

  • (String)

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/tinybucket/model/branch.rb', line 20

class Branch < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes :links, :type, :name, :repository, :target

  # Returns the commits available for the specific branch
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource.branch(name, options)
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def branches_api
    create_api('Branches', repo_keys)
  end

  def load_model
    branches_api.find(name, {})
  end
end

Instance Method Details

#commits(options = {}) ⇒ Tinybucket::Resource::Commits

Returns the commits available for the specific branch

Parameters:

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

Returns:


29
30
31
# File 'lib/tinybucket/model/branch.rb', line 29

def commits(options = {})
  commits_resource.branch(name, options)
end