Class: TicketMaster::Provider::Bugherd::Ticket
- Inherits:
-
TicketMaster::Provider::Base::Ticket
- Object
- TicketMaster::Provider::Base::Ticket
- TicketMaster::Provider::Bugherd::Ticket
- Defined in:
- lib/provider/ticket.rb
Overview
Ticket class for ticketmaster-bugherd
Constant Summary collapse
- API =
The class to access the api’s tickets
BugherdAPI::Task
- STATUS =
%w{new todo active declined fixed closed}
- PRIORITY =
%w{- critical important normal minor}
Class Method Summary collapse
Instance Method Summary collapse
- #assignee ⇒ Object
- #comments(*options) ⇒ Object
- #priority ⇒ Object
- #project_id ⇒ Object
-
#status ⇒ Object
declare needed overloaded methods here.
Class Method Details
.search(project_id, options = {}, limit = 1000) ⇒ Object
31 32 33 34 35 |
# File 'lib/provider/ticket.rb', line 31 def self.search(project_id, = {}, limit = 1000) API.find(:all, :params => {:project_id => project_id}).collect do |task| self.new task end end |
Instance Method Details
#assignee ⇒ Object
20 21 22 23 24 25 |
# File 'lib/provider/ticket.rb', line 20 def assignee user = BugherdAPI::User.find(:all).select do |user| user.id == self[:assigned_to_id] end.first "#{user.name} #{user.surname}" end |
#comments(*options) ⇒ Object
37 38 39 40 |
# File 'lib/provider/ticket.rb', line 37 def comments(*) warn "Bugherd API doesn't support comments" [] end |
#priority ⇒ Object
16 17 18 |
# File 'lib/provider/ticket.rb', line 16 def priority PRIORITY[self[:priority_id]] end |
#project_id ⇒ Object
27 28 29 |
# File 'lib/provider/ticket.rb', line 27 def project_id self.[:project_id] end |
#status ⇒ Object
declare needed overloaded methods here
12 13 14 |
# File 'lib/provider/ticket.rb', line 12 def status STATUS[self[:status_id]] end |