class Zendesk2::TicketAudits

Public Instance Methods

all(params = {}) click to toggle source
# File lib/zendesk2/ticket_audits.rb, line 20
def all(params = {})
  requires :ticket_id

  body = cistern.send(collection_method, { 'ticket_id' => ticket_id }.merge(params)).body

  collection = clone.load(body[collection_root])
  collection.merge_attributes(Cistern::Hash.slice(body, 'count', 'next_page', 'previous_page'))
  collection
end
get(id) click to toggle source
# File lib/zendesk2/ticket_audits.rb, line 30
def get(id)
  requires :ticket_id
  data = cistern.send(model_method, 'ticket_id' => ticket_id, 'id' => id).body[model_root]
  new(data) if data
rescue Zendesk2::Error
  nil
end
ticket() click to toggle source
# File lib/zendesk2/ticket_audits.rb, line 16
def ticket
  cistern.tickets.get(ticket_id)
end