Class: OctadeskApi::Client::PersonApi
- Inherits:
-
Object
- Object
- OctadeskApi::Client::PersonApi
- Defined in:
- lib/octadesk_api/client/person_api.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #create(options = {}) ⇒ Object
- #find(id) ⇒ Object
- #find_by_email(email) ⇒ Object
-
#initialize(client) ⇒ PersonApi
constructor
A new instance of PersonApi.
- #update(id, options = {}) ⇒ Object
- #where(options = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ PersonApi
Returns a new instance of PersonApi.
5 6 7 |
# File 'lib/octadesk_api/client/person_api.rb', line 5 def initialize(client) self.client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/octadesk_api/client/person_api.rb', line 4 def client @client end |
Instance Method Details
#create(options = {}) ⇒ Object
24 25 26 27 |
# File 'lib/octadesk_api/client/person_api.rb', line 24 def create( = {}) response = client.post("/persons", ) response.parsed_response end |
#find(id) ⇒ Object
9 10 11 12 |
# File 'lib/octadesk_api/client/person_api.rb', line 9 def find(id) response = client.get("/persons/#{id}") response.parsed_response end |
#find_by_email(email) ⇒ Object
14 15 16 17 |
# File 'lib/octadesk_api/client/person_api.rb', line 14 def find_by_email(email) response = client.get("/persons/", {query: {email: email} }) response.parsed_response end |
#update(id, options = {}) ⇒ Object
29 30 31 32 |
# File 'lib/octadesk_api/client/person_api.rb', line 29 def update(id, = {}) response = client.put("/persons/#{id}", ) response.parsed_response end |
#where(options = {}) ⇒ Object
19 20 21 22 |
# File 'lib/octadesk_api/client/person_api.rb', line 19 def where( = {}) response = client.post("/persons/filter", ) response.parsed_response end |