Module: Calendars
- Included in:
- Config
- Defined in:
- lib/user/config/calendars.rb
Instance Method Summary collapse
-
#create_calendar(data) ⇒ Object
Create calendar.
-
#delete_calendar(id) ⇒ Object
Delete calendar.
-
#get_calendar(id, options = nil) ⇒ Object
Get calendar.
-
#get_calendars(options = nil) ⇒ Object
Get calendars.
-
#update_calendar(id, data) ⇒ Object
Update calendar.
Instance Method Details
#create_calendar(data) ⇒ Object
Create calendar.
Create a calendar with data.
Parameters
- data
-
(Hash) – Data to be submited.
Example
data = {
"title": "New Calendar",
"object_type": "contacts",
"object_id": 1
}
@data = @mints_user.create_calendar(data)
56 57 58 |
# File 'lib/user/config/calendars.rb', line 56 def create_calendar(data) return @client.raw("post", "/config/calendars", nil, data_transform(data)) end |
#delete_calendar(id) ⇒ Object
Delete calendar.
Delete a calendar.
Parameters
- id
-
(Integer) – Calendar id.
Example
@data = @mints_user.delete_calendar(4)
86 87 88 |
# File 'lib/user/config/calendars.rb', line 86 def delete_calendar(id) return @client.raw("delete", "/config/calendars/#{id}") end |
#get_calendar(id, options = nil) ⇒ Object
Get calendar.
Get a calendar info.
Parameters
- id
-
(Integer) – Calendar id.
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_calendar(1)
Second Example
= {
"fields": "title"
}
@data = @mints_user.get_calendar(1, )
39 40 41 |
# File 'lib/user/config/calendars.rb', line 39 def get_calendar(id, = nil) return @client.raw("get", "/config/calendars/#{id}", ) end |
#get_calendars(options = nil) ⇒ Object
Get calendars.
Get a collection of calendars.
Parameters
- options
-
(Hash) – List of Resource Collection Options shown above can be used as parameter.
First Example
@data = @mints_user.get_calendars
Second Example
= {
"fields": "title"
}
@data = @mints_user.get_calendars()
20 21 22 |
# File 'lib/user/config/calendars.rb', line 20 def get_calendars( = nil) return @client.raw("get", "/config/calendars", ) end |
#update_calendar(id, data) ⇒ Object
Update calendar.
Update a calendar info.
Parameters
- id
-
(Integer) – Calendar id.
- data
-
(Hash) – Data to be submited.
Example
data = {
"title": "New Calendar Modified",
"object_type": "contacts",
"object_id": 1
}
@data = @mints_user.update_calendar(4, data)
74 75 76 |
# File 'lib/user/config/calendars.rb', line 74 def update_calendar(id, data) return @client.raw("put", "/config/calendars/#{id}", nil, data_transform(data)) end |