Class: Timekit::Booking::Client
- Inherits:
-
Client
- Object
- Client
- Timekit::Booking::Client
show all
- Defined in:
- lib/timekit/booking/client.rb
Overview
Client class for the booking resource
Constant Summary
collapse
- API_PATH =
'/bookings'
Instance Method Summary
collapse
Methods inherited from Client
#initialize
Instance Method Details
#create(graph, event, customer, action = nil) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/timekit/booking/client.rb', line 17
def create(
graph,
event,
customer,
action = nil
)
params = {
graph: graph,
event: event,
customer: customer
}
params[:action] = action if action
post(API_PATH, params)
end
|
#list ⇒ Object
9
10
11
|
# File 'lib/timekit/booking/client.rb', line 9
def list
get(API_PATH)
end
|
#show(id) ⇒ Object
13
14
15
|
# File 'lib/timekit/booking/client.rb', line 13
def show(id)
get(API_PATH + '/' + id)
end
|
#update(id, action) ⇒ Object
34
35
36
37
38
39
|
# File 'lib/timekit/booking/client.rb', line 34
def update(
id,
action
)
put(API_PATH + '/' + id + '/' + action)
end
|