Module: BusinessInsightApiClient::Api::Animals
- Included in:
- Client
- Defined in:
- lib/business_insight_api_client/api/animals.rb
Overview
Animal API based methods. This module contains methods to query the Animal API.
Instance Method Summary collapse
-
#animal(animal_id) ⇒ BusinessInsightApiClient::Mash
get: ‘/animals/:id’.
-
#animal_with_life_number(life_number) ⇒ BusinessInsightApiClient::Mash
get: ‘/animals/with_life_number/:life_number’.
-
#animal_with_number(number) ⇒ BusinessInsightApiClient::Mash
get: ‘/animals/with_number/:number’.
-
#animal_with_responder(responder) ⇒ BusinessInsightApiClient::Mash
get: ‘/animals/animal_with_responder/:responder’.
-
#animals ⇒ BusinessInsightApiClient::Mash
get: ‘/animals’.
-
#create_animal(animal = {}) ⇒ BusinessInsightApiClient::Mash
post: ‘/animals/:animal’.
-
#delete_animal(animal_id) ⇒ BusinessInsightApiClient::Mash
delete: ‘/animals/:animal_id’.
-
#update_animal(animal_id, animal = {}) ⇒ BusinessInsightApiClient::Mash
put: ‘/animals/:animal_id’.
Instance Method Details
#animal(animal_id) ⇒ BusinessInsightApiClient::Mash
get: ‘/animals/:id’
19 20 21 |
# File 'lib/business_insight_api_client/api/animals.rb', line 19 def animal(animal_id) ::BusinessInsightApiClient::Mash.from_json client.get("/animals/#{animal_id}") end |
#animal_with_life_number(life_number) ⇒ BusinessInsightApiClient::Mash
get: ‘/animals/with_life_number/:life_number’
27 28 29 30 |
# File 'lib/business_insight_api_client/api/animals.rb', line 27 def animal_with_life_number(life_number) body = { life_number: life_number } ::BusinessInsightApiClient::Mash.from_json client.get('/animals/with_life_number', body: body) end |
#animal_with_number(number) ⇒ BusinessInsightApiClient::Mash
get: ‘/animals/with_number/:number’
45 46 47 48 |
# File 'lib/business_insight_api_client/api/animals.rb', line 45 def animal_with_number(number) body = { number: number } ::BusinessInsightApiClient::Mash.from_json client.get('/animals/with_number', body: body) end |
#animal_with_responder(responder) ⇒ BusinessInsightApiClient::Mash
get: ‘/animals/animal_with_responder/:responder’
36 37 38 39 |
# File 'lib/business_insight_api_client/api/animals.rb', line 36 def animal_with_responder(responder) body = { responder: responder } ::BusinessInsightApiClient::Mash.from_json client.get('/animals/with_responder', body: body) end |
#animals ⇒ BusinessInsightApiClient::Mash
get: ‘/animals’
10 11 12 |
# File 'lib/business_insight_api_client/api/animals.rb', line 10 def animals ::BusinessInsightApiClient::Mash.from_json client.get('/animals') end |
#create_animal(animal = {}) ⇒ BusinessInsightApiClient::Mash
post: ‘/animals/:animal’
54 55 56 |
# File 'lib/business_insight_api_client/api/animals.rb', line 54 def create_animal(animal={}) ::BusinessInsightApiClient::Mash.from_json client.post('/animals', animal.to_json) end |
#delete_animal(animal_id) ⇒ BusinessInsightApiClient::Mash
delete: ‘/animals/:animal_id’
71 72 73 |
# File 'lib/business_insight_api_client/api/animals.rb', line 71 def delete_animal(animal_id) ::BusinessInsightApiClient::Mash.from_json client.delete("/animals/#{animal_id}") end |
#update_animal(animal_id, animal = {}) ⇒ BusinessInsightApiClient::Mash
put: ‘/animals/:animal_id’
63 64 65 |
# File 'lib/business_insight_api_client/api/animals.rb', line 63 def update_animal(animal_id,animal={}) ::BusinessInsightApiClient::Mash.from_json client.put("/animals/#{animal_id}", animal.to_json) end |