Class: TicketMaster::Provider::Bugshelf::Ticket

Inherits:
TicketMaster::Provider::Base::Ticket
  • Object
show all
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(*options)
  if options.first.is_a? Hash
    options.first.merge!(
      :details => options.first.delete(:description)
    )
    task = API.new(options.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, options = {}, limit = 1000)
 tickets = API.find(:all, :params => {:project_id => project_id, :per_page => limit})
 search_by_attribute(tickets, options, limit)
end

Instance Method Details

#descriptionObject



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(*options)
  @system_data[:client].destroy.is_a?(Net::HTTPOK)
end

#idObject



30
31
32
# File 'lib/provider/ticket.rb', line 30

def id
  @system_data[:client].string_id
end