Module: TicketMaster::Provider::Jira
- Includes:
- Base
- Defined in:
- lib/provider/jira.rb,
lib/provider/ticket.rb,
lib/provider/comment.rb,
lib/provider/project.rb
Overview
This is the Jira Provider for ticketmaster
Defined Under Namespace
Classes: Comment, Project, Ticket
Class Method Summary collapse
-
.new(auth = {}) ⇒ Object
This is for cases when you want to instantiate using TicketMaster::Provider::Jira.new(auth).
Instance Method Summary collapse
-
#authorize(auth = {}) ⇒ Object
Providers must define an authorize method.
-
#project(*options) ⇒ Object
declare needed overloaded methods here.
- #projects(*options) ⇒ Object
- #valid? ⇒ Boolean
Class Method Details
.new(auth = {}) ⇒ Object
This is for cases when you want to instantiate using TicketMaster::Provider::Jira.new(auth)
9 10 11 |
# File 'lib/provider/jira.rb', line 9 def self.new(auth = {}) TicketMaster.new(:jira, auth) end |
Instance Method Details
#authorize(auth = {}) ⇒ Object
Providers must define an authorize method. This is used to initialize and set authentication parameters to access the API
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/provider/jira.rb', line 15 def (auth = {}) @authentication ||= TicketMaster::Authenticator.new(auth) $jira = Jira4R::JiraTool.new(2,@authentication.url) begin $jira.login(@authentication.username, @authentication.password) @valid_auth = true rescue @valid_auth = false end # Set authentication parameters for whatever you're using to access the API end |
#project(*options) ⇒ Object
declare needed overloaded methods here
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/provider/jira.rb', line 29 def project(*) if .first.is_a? String [0] = [0].to_i end if .first.is_a? Fixnum Project.find_by_id(.first) elsif .first.is_a? Hash Project.find_by_attributes(.first).first end end |
#projects(*options) ⇒ Object
40 41 42 |
# File 'lib/provider/jira.rb', line 40 def projects(*) Project.find() end |
#valid? ⇒ Boolean
44 45 46 |
# File 'lib/provider/jira.rb', line 44 def valid? @valid_auth end |