Class: Octopi::Branch

Included Modules

Octopi::Resource

Attributes

Instance Attributes

name [RW] public

Sets the attribute name.

sha [RW] public

Sets the attribute sha.

Constants Inherited from Octopi::Base

VALID

Constructor Summary

public initialize(*args)

Called when we ask for a resource. Arguments are passed in like [<name>, <sha>] TODO: Find out why args are doubly nested

[View source]


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

def initialize(*args)
  args = args.flatten!
  self.name = args.first
  self.sha = args.last
end

Public Visibility

Public Class Method Summary

all(opts = {})

Public Instance Method Summary

#to_s

Public Instance Methods Inherited from Octopi::Base

error=, property, save

Public Class Method Details

all

public all(opts = {})
[View source]


22
23
24
25
26
27
28
# File 'lib/octopi/branch.rb', line 22

def self.all(opts={})
  user, repo = gather_details(opts)
  self.validate_args(user => :user, repo => :repo)
  BranchSet.new(find_plural([user, repo, 'branches'], :resource)) do |i|
    { :name => i.first, :hash => i.last }
  end
end

Public Instance Method Details

to_s

public to_s
[View source]


18
19
20
# File 'lib/octopi/branch.rb', line 18

def to_s
  name
end
Generated on Friday, July 31 2009 at 05:01:56 PM by YARD 0.2.3.2 (ruby-1.8.6).