Class: Octopi::Branch
- Includes:
- Resource
- Defined in:
- lib/octopi/branch.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#sha ⇒ Object
Returns the value of attribute sha.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Branch
constructor
Called when we ask for a resource.
- #to_s ⇒ Object
Methods included from Resource
Methods inherited from Base
Constructor Details
#initialize(*args) ⇒ Branch
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
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/octopi/branch.rb', line 3 def name @name end |
#sha ⇒ Object
Returns the value of attribute sha.
3 4 5 |
# File 'lib/octopi/branch.rb', line 3 def sha @sha end |
Class Method Details
.all(options = {}) ⇒ Object
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
#to_s ⇒ Object
18 19 20 |
# File 'lib/octopi/branch.rb', line 18 def to_s name end |