Class: Octopi::Branch

Inherits:
Base
  • Object
show all
Includes:
Resource
Defined in:
lib/octopi/branch.rb

Constant Summary

Constants inherited from Base

Octopi::Base::VALID

Instance Attribute Summary

Attributes inherited from Base

#api

Class Method Summary collapse

Methods included from Resource

for, included

Methods inherited from Base

#initialize, #property, #save

Constructor Details

This class inherits a constructor from Octopi::Base

Class Method Details

.find(user, repo, api = ANONYMOUS_API) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/octopi/branch.rb', line 8

def self.find(user, repo, api=ANONYMOUS_API)
  user = user. if user.is_a? User
  repo = repo.name if repo.is_a? Repository
  self.validate_args(user => :user, repo => :repo)
  api = ANONYMOUS_API if repo.is_a?(Repository) && !repo.private
  find_plural([user,repo,'branches'], :resource, api){
    |i| {:name => i.first, :hash => i.last }
  }
end