Class: OctadeskApi::Client::TicketApi

Inherits:
Object
  • Object
show all
Defined in:
lib/octadesk_api/client/ticket_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ TicketApi

Returns a new instance of TicketApi.



5
6
7
# File 'lib/octadesk_api/client/ticket_api.rb', line 5

def initialize(client)
  self.client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



4
5
6
# File 'lib/octadesk_api/client/ticket_api.rb', line 4

def client
  @client
end

Instance Method Details

#create(options = {}) ⇒ Object



19
20
21
22
# File 'lib/octadesk_api/client/ticket_api.rb', line 19

def create(options = {})
  response = client.post("/tickets", options)
  response.parsed_response
end

#find(id) ⇒ Object



9
10
11
12
# File 'lib/octadesk_api/client/ticket_api.rb', line 9

def find(id) 
  response = client.get("/tickets/#{id}")
  response.parsed_response
end

#update(id, options = {}) ⇒ Object



24
25
26
27
# File 'lib/octadesk_api/client/ticket_api.rb', line 24

def update(id, options = {})
  response = client.put("/tickets/#{id}", options)
  response.parsed_response
end

#where(options = {}) ⇒ Object



14
15
16
17
# File 'lib/octadesk_api/client/ticket_api.rb', line 14

def where(options = {})
  response = client.post("/tickets", options)
  response.parsed_response
end