Class: TuneupTechnology::Customer

Inherits:
Object
  • Object
show all
Defined in:
lib/tuneuptechnology/customer.rb

Overview

Methods for the Customer object

Class Method Summary collapse

Class Method Details

.all(data) ⇒ Object

Retrieve all customer records



13
14
15
16
# File 'lib/tuneuptechnology/customer.rb', line 13

def self.all(data)
  endpoint = Client.base_url + 'customers'
  Client.post(data, endpoint)
end

.create(data) ⇒ Object

Create a customer



7
8
9
10
# File 'lib/tuneuptechnology/customer.rb', line 7

def self.create(data)
  endpoint = Client.base_url + 'customers/create'
  Client.post(data, endpoint)
end

.delete(data) ⇒ Object

Delete a customer record



31
32
33
34
# File 'lib/tuneuptechnology/customer.rb', line 31

def self.delete(data)
  endpoint = Client.base_url + 'customers/' + data['id'].to_s + '/delete'
  Client.post(data, endpoint)
end

.retrieve(data) ⇒ Object

Retrieve a single customer record



19
20
21
22
# File 'lib/tuneuptechnology/customer.rb', line 19

def self.retrieve(data)
  endpoint = Client.base_url + 'customers/' + data['id'].to_s
  Client.post(data, endpoint)
end

.update(data) ⇒ Object

Update a customer record



25
26
27
28
# File 'lib/tuneuptechnology/customer.rb', line 25

def self.update(data)
  endpoint = Client.base_url + 'customers/' + data['id'].to_s + '/update'
  Client.post(data, endpoint)
end