Module: Unforlogistics::Core::Couriers

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

Instance Method Summary collapse

Instance Method Details

#create_courier(attrs = {}) ⇒ Object



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

def create_courier(attrs={})
  response = post_request('/couriers', attrs)

  get_persistance_response(response)
end

#disable_courier(id) ⇒ Object



32
33
34
35
36
# File 'lib/unforlogistics/core/couriers.rb', line 32

def disable_courier(id)
  response = put_request("/couriers/#{id}/disabled")

  get_persistance_response(response)
end

#enable_courier(id) ⇒ Object



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

def enable_courier(id)
  response = put_request("/couriers/#{id}/enabled")

  get_persistance_response(response)
end

#get_courier(id) ⇒ Object



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

def get_courier(id)
  get_request("/couriers/#{id}").body
end

#get_couriers(filters = {}) ⇒ Object



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

def get_couriers(filters={})
  response = get_request('/couriers', filters)

  get_paging_response(response)
end

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



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

def update_courier(id, attrs={})
  response = put_request("/couriers/#{id}", attrs)

  get_persistance_response(response)
end