Class: Octopi::Branch
- Inherits:
-
Base
- Object
- Base
- Octopi::Branch
- Includes:
- Resource
- Defined in:
- lib/octopi/branch.rb
Constant Summary
Constant Summary
Constants inherited from Base
Instance Attribute Summary (collapse)
-
- (Object) name
Returns the value of attribute name.
-
- (Object) sha
Returns the value of attribute sha.
Attributes inherited from Base
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Branch) initialize(*args)
constructor
Called when we ask for a resource.
- - (Object) to_s
Methods included from Resource
Methods inherited from Base
Constructor Details
- (Branch) initialize(*args)
Called when we ask for a resource. Arguments are passed in like [<name>, <sha>] TODO: Find out why args are doubly nested
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 |
Instance Attribute Details
- (Object) name
Returns the value of attribute name
3 4 5 |
# File 'lib/octopi/branch.rb', line 3 def name @name end |
- (Object) sha
Returns the value of attribute sha
3 4 5 |
# File 'lib/octopi/branch.rb', line 3 def sha @sha end |
Class Method Details
+ (Object) all(options = {})
22 23 24 25 26 27 28 29 |
# File 'lib/octopi/branch.rb', line 22 def self.all(={}) ensure_hash() user, repo = gather_details() 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 |
Instance Method Details
- (Object) to_s
18 19 20 |
# File 'lib/octopi/branch.rb', line 18 def to_s name end |