Class: Onfleet::Administrators

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

Overview

Administrators are users who perform actions via the dashboard.

Instance Method Summary collapse

Instance Method Details

#create(config, body) ⇒ Object



6
7
8
9
10
11
# File 'lib/resources/administrators.rb', line 6

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

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

#delete(config, id) ⇒ Object



27
28
29
30
31
32
# File 'lib/resources/administrators.rb', line 27

def delete(config, id)
  method = 'delete'
  path = "admins/#{id}"

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

#list(config) ⇒ Object



13
14
15
16
17
18
# File 'lib/resources/administrators.rb', line 13

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

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

#update(config, id, body) ⇒ Object



20
21
22
23
24
25
# File 'lib/resources/administrators.rb', line 20

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

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