class Eligible::Ticket
Public Class Methods
all(params, api_key = nil)
click to toggle source
# File lib/eligible/ticket.rb, line 24 def self.all(params, api_key = nil) send_request(:get, ticket_url, api_key, params) end
comments(params, api_key = nil)
click to toggle source
# File lib/eligible/ticket.rb, line 20 def self.comments(params, api_key = nil) send_request(:post, ticket_url(params, true), api_key, params, :id) end
create(params, api_key = nil)
click to toggle source
# File lib/eligible/ticket.rb, line 16 def self.create(params, api_key = nil) send_request(:post, ticket_url, api_key, params) end
delete(params, api_key = nil)
click to toggle source
# File lib/eligible/ticket.rb, line 32 def self.delete(params, api_key = nil) send_request(:delete, ticket_url(params), api_key, params, :id) end
get(params, api_key = nil)
click to toggle source
# File lib/eligible/ticket.rb, line 28 def self.get(params, api_key = nil) send_request(:get, ticket_url(params), api_key, params, :id) end
ticket_url(params = nil, comments = false)
click to toggle source
# File lib/eligible/ticket.rb, line 3 def self.ticket_url(params = nil, comments = false) if params.nil? '/tickets' else id = Util.value(params, :id) if comments "/tickets/#{id}/comments" else "/tickets/#{id}" end end end
update(params, api_key = nil)
click to toggle source
# File lib/eligible/ticket.rb, line 36 def self.update(params, api_key = nil) send_request(:put, ticket_url(params), api_key, params, :id) end