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

Instance Method Details

#animal(animal_id) ⇒ BusinessInsightApiClient::Mash

get: ‘/animals/:id’

Parameters:

  • animal_id (Integer)

    animal id

Returns:

See Also:



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’

Parameters:

  • life_number (String)

    animal life number

Returns:

See Also:



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’

Parameters:

  • number (Integer)

    animal number

Returns:

See Also:



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’

Parameters:

  • responder (String)

    animal responder

Returns:

See Also:



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

#animalsBusinessInsightApiClient::Mash

get: ‘/animals’

Returns:

See Also:



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’

Parameters:

  • animal (Hash) (defaults to: {})

    animal to be created. See docs for parameters.

Returns:

See Also:



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’

Parameters:

  • animal_id (Integer)

    animal to be deleted.

Returns:

See Also:



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’

Parameters:

  • animal_id (Integer)

    animal to be updated.

  • animal (Hash) (defaults to: {})

    animal to be updated. See docs for parameters.

Returns:

See Also:



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