Module: TicketMaster::Provider::Github
- Includes:
- Base
- Defined in:
- lib/provider/github.rb,
lib/provider/project.rb,
lib/provider/comment.rb,
lib/provider/ticket.rb,
lib/github/github.rb
Overview
This is the Github Provider for ticketmaster
Defined Under Namespace
Classes: Comment, GithubComment, Project, Ticket
Constant Summary collapse
- PROJECT_API =
Octopi::Repository
- ISSUE_API =
Octopi::Issue
Class Attribute Summary collapse
-
.login ⇒ Object
Returns the value of attribute login.
Class Method Summary collapse
-
.new(auth = {}) ⇒ Object
This is for cases when you want to instantiate using TicketMaster::Provider::Github.new(auth).
Instance Method Summary collapse
-
#authorize(auth = {}) ⇒ Object
declare needed overloaded methods here.
- #project(*name) ⇒ Object
- #projects(*options) ⇒ Object
Class Attribute Details
.login ⇒ Object
Returns the value of attribute login.
9 10 11 |
# File 'lib/provider/github.rb', line 9 def login @login end |
Class Method Details
.new(auth = {}) ⇒ Object
This is for cases when you want to instantiate using TicketMaster::Provider::Github.new(auth)
13 14 15 |
# File 'lib/provider/github.rb', line 13 def self.new(auth = {}) TicketMaster.new(:github, auth) end |
Instance Method Details
#authorize(auth = {}) ⇒ Object
declare needed overloaded methods here
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/provider/github.rb', line 18 def (auth = {}) @authentication ||= TicketMaster::Authenticator.new(auth) auth = @authentication if auth.token.nil? or (auth.login.nil? and auth.username.nil?) TicketMaster::Provider::Github.login = auth.login || auth.username return else Octopi::Api.api = Octopi::AuthApi.instance Octopi::Api.api.token = auth.token unless auth.token.blank? Octopi::Api.api.login = auth.login || auth.username end end |
#project(*name) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/provider/github.rb', line 39 def project(*name) unless name.empty? Project.find(name.first) else super end end |
#projects(*options) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/provider/github.rb', line 31 def projects(*) if .empty? PROJECT_API.find(:user => TicketMaster::Provider::Github.login).collect{|repo| Project.new repo} elsif .first.is_a?(Array) .collect{|name| Project.find(name)}.first end end |