Class: Alman::CalendarsEndpoint
Instance Attribute Summary
Attributes inherited from ApiEndpoint
#client, #parent
Instance Method Summary
collapse
Methods inherited from ApiEndpoint
#initialize
Instance Method Details
#all(params = {}, headers = {}) ⇒ Object
8
9
10
11
12
|
# File 'lib/alman/endpoints/calendars_endpoint.rb', line 8
def all(params={}, ={})
method = ApiMethod.new(:get, "/calendars", params, , @parent)
json = @client.execute(method)
ApiList.new(:Calendar, json, method)
end
|
#create(params = {}, headers = {}) ⇒ Object
41
42
43
44
45
|
# File 'lib/alman/endpoints/calendars_endpoint.rb', line 41
def create(params={}, ={})
method = ApiMethod.new(:post, "/calendars", params, , @parent)
json = @client.execute(method)
Calendar.new(json, method)
end
|
#delete(calendar_id, params = {}, headers = {}) ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/alman/endpoints/calendars_endpoint.rb', line 23
def delete(calendar_id, params={}, ={})
params = ParamsBuilder.merge({
:calendar_id => calendar_id,
}, params)
method = ApiMethod.new(:delete, "/calendars/:calendar_id", params, , @parent)
json = @client.execute(method)
Calendar.new(json, method)
end
|
#new(id) ⇒ Object
4
5
6
|
# File 'lib/alman/endpoints/calendars_endpoint.rb', line 4
def new(id)
Calendar.new({:id => id}, nil, @client)
end
|
#retrieve(calendar_id, params = {}, headers = {}) ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/alman/endpoints/calendars_endpoint.rb', line 14
def retrieve(calendar_id, params={}, ={})
params = ParamsBuilder.merge({
:calendar_id => calendar_id,
}, params)
method = ApiMethod.new(:get, "/calendars/:calendar_id", params, , @parent)
json = @client.execute(method)
Calendar.new(json, method)
end
|
#update(calendar_id, params = {}, headers = {}) ⇒ Object
32
33
34
35
36
37
38
39
|
# File 'lib/alman/endpoints/calendars_endpoint.rb', line 32
def update(calendar_id, params={}, ={})
params = ParamsBuilder.merge({
:calendar_id => calendar_id,
}, params)
method = ApiMethod.new(:put, "/calendars/:calendar_id", params, , @parent)
json = @client.execute(method)
Calendar.new(json, method)
end
|