Class: TicketMaster::Provider::Bugshelf::Ticket
- Inherits:
-
TicketMaster::Provider::Base::Ticket
- Object
- TicketMaster::Provider::Base::Ticket
- TicketMaster::Provider::Bugshelf::Ticket
- Defined in:
- lib/provider/ticket.rb
Overview
Ticket class for ticketmaster-bugshelf
Constant Summary collapse
- API =
The class to access the api’s tickets
BugshelfAPI::Issue
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.create(*options) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/provider/ticket.rb', line 14 def self.create(*) if .first.is_a? Hash .first.merge!( :details => .first.delete(:description) ) task = API.new(.first) ticket = self.new task task.save ticket end end |
.search(project_id, options = {}, limit = 1000) ⇒ Object
9 10 11 12 |
# File 'lib/provider/ticket.rb', line 9 def self.search(project_id, = {}, limit = 1000) tickets = API.find(:all, :params => {:project_id => project_id, :per_page => limit}) search_by_attribute(tickets, , limit) end |
Instance Method Details
#description ⇒ Object
34 35 36 |
# File 'lib/provider/ticket.rb', line 34 def description self.details end |
#destroy(*options) ⇒ Object
26 27 28 |
# File 'lib/provider/ticket.rb', line 26 def destroy(*) @system_data[:client].destroy.is_a?(Net::HTTPOK) end |
#id ⇒ Object
30 31 32 |
# File 'lib/provider/ticket.rb', line 30 def id @system_data[:client].string_id end |