Module: Unforlogistics::Core::Phones

Included in:
Api
Defined in:
lib/unforlogistics/core/phones.rb

Instance Method Summary collapse

Instance Method Details

#create_phone(attrs = {}) ⇒ Object



14
15
16
17
18
# File 'lib/unforlogistics/core/phones.rb', line 14

def create_phone(attrs={})
  response = post_request('/phones', attrs)

  get_persistance_response(response)
end

#get_phone(id) ⇒ Object



10
11
12
# File 'lib/unforlogistics/core/phones.rb', line 10

def get_phone(id)
  get_request("/phones/#{id}").body
end

#get_phones(filters = {}) ⇒ Object



4
5
6
7
8
# File 'lib/unforlogistics/core/phones.rb', line 4

def get_phones(filters={})
  response = get_request('/phones', filters)

  get_paging_response(response)
end

#set_phone_status(id, status) ⇒ Object



26
27
28
29
30
# File 'lib/unforlogistics/core/phones.rb', line 26

def set_phone_status(id, status)
  response = put_request("/phones/#{id}/status", { value: status })

  get_persistance_response(response)
end

#update_phone(id, attrs = {}) ⇒ Object



20
21
22
23
24
# File 'lib/unforlogistics/core/phones.rb', line 20

def update_phone(id, attrs={})
  response = put_request("/phones/#{id}", attrs)

  get_persistance_response(response)
end