Module: Unforlogistics::Core::Addresses

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

Instance Method Summary collapse

Instance Method Details

#create_address(attrs = {}) ⇒ Object



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

def create_address(attrs={})
  response = post_request('/addresses', attrs)

  get_persistance_response(response)
end

#get_address(id) ⇒ Object



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

def get_address(id)
  get_request("/addresses/#{id}").body
end

#get_addresses(filters = {}) ⇒ Object



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

def get_addresses(filters={})
  response = get_request('/addresses', filters)

  get_paging_response(response)
end

#set_address_status(id, status) ⇒ Object



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

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

  get_persistance_response(response)
end

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



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

def update_address(id, attrs={})
  response = put_request('/addresses', attrs)

  get_persistance_response(response)
end