Class: GitWand::GitHub::Resource::Branch

Inherits:
Object
  • Object
show all
Defined in:
lib/git_wand/github/resource/branch.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#commitObject

Returns the value of attribute commit.



5
6
7
# File 'lib/git_wand/github/resource/branch.rb', line 5

def commit
  @commit
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/git_wand/github/resource/branch.rb', line 5

def name
  @name
end

Class Method Details

.build_from_api_result(result) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/git_wand/github/resource/branch.rb', line 7

def self.build_from_api_result(result)
  return unless result.success?
  resource = new
  resource.name = result.body["name"]
  resource.commit = result.body["commit"]
  resource
end