Class: Onfleet::Hubs

Inherits:
Object
  • Object
show all
Defined in:
lib/resources/hubs.rb

Overview

A hub is a home base for a team. It may be the location from where all deliveries originate for that team. A hub could be distribution center or a restaurant, or it may be a centralized location for drivers. Teams may have zero or one hub, and several teams may share a hub.

Instance Method Summary collapse

Instance Method Details

#create(config, body) ⇒ Object



8
9
10
11
12
13
# File 'lib/resources/hubs.rb', line 8

def create(config, body)
  method = 'post'
  path = 'hubs'

  Onfleet.request(config, method.to_sym, path, body.to_json)
end

#list(config) ⇒ Object



15
16
17
18
19
20
# File 'lib/resources/hubs.rb', line 15

def list(config)
  method = 'get'
  path = 'hubs'

  Onfleet.request(config, method.to_sym, path)
end

#update(config, id, body) ⇒ Object



22
23
24
25
26
27
# File 'lib/resources/hubs.rb', line 22

def update(config, id, body)
  method = 'put'
  path = "hubs/#{id}"

  Onfleet.request(config, method.to_sym, path, body.to_json)
end