Sha256: 9d7604fb60733728cfe4ce53b56a785fc345fffc614a936c3649cb50b327343a
Contents?: true
Size: 1.05 KB
Versions: 27
Compression:
Stored size: 1.05 KB
Contents
module Eligible class Ticket < APIResource 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 def self.create(params, opts = {}) send_request :post, ticket_url, params, opts end def self.comments(params, opts = {}) send_request :post, ticket_url(params, true), params, opts.merge(required_params: [:id]) end def self.all(params, opts = {}) send_request :get, ticket_url, params, opts end def self.get(params, opts = {}) send_request :get, ticket_url(params), params, opts.merge(required_params: [:id]) end def self.delete(params, opts = {}) send_request :delete, ticket_url(params), params, opts.merge(required_params: [:id]) end def self.update(params, opts = {}) send_request :put, ticket_url(params), params, opts.merge(required_params: [:id]) end end end
Version data entries
27 entries across 27 versions & 1 rubygems