Class: Octopi::Tag

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

Constant Summary

Constant Summary

Constants inherited from Base

Base::VALID

Instance Attribute Summary (collapse)

Attributes inherited from Base

#api

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from Resource

for, included

Methods inherited from Base

#error=, #property, #save

Constructor Details

- (Tag) initialize(*args)

Returns a new instance of Tag



10
11
12
13
14
# File 'lib/octopi/tag.rb', line 10

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



5
6
7
# File 'lib/octopi/tag.rb', line 5

def name
  @name
end

- (Object) sha

Returns the value of attribute sha



5
6
7
# File 'lib/octopi/tag.rb', line 5

def sha
  @sha
end

Class Method Details

+ (Object) all(options = {})



16
17
18
19
20
21
# File 'lib/octopi/tag.rb', line 16

def self.all(options={})
  ensure_hash(options)
  user, repo = gather_details(options)
  self.validate_args(user => :user, repo => :repo)
  find_plural([user, repo, 'tags'], :resource) { |i| Tag.new(i) }
end