Class: Ribose::Event
- Includes:
- Actions::Create, Actions::Delete, Actions::Fetch, Actions::Update
- Defined in:
- lib/ribose/event.rb
Class Method Summary collapse
-
.all(calendar_id, options = {}) ⇒ Sawyer::Resource
List calendar events.
-
.create(calendar_id, attrs, options = {}) ⇒ Sawyer::Resource
Create a calendar event.
-
.delete(calendar_id, event_id, options = {}) ⇒ Object
Delete a calendar event.
-
.fetch(calendar_id, event_id, options = {}) ⇒ Sawyer::Resource
Fetch a calendar event.
-
.update(calendar_id, event_id, attributes, options = {}) ⇒ Object
Update a calendar event.
Methods included from Actions::Delete
Methods included from Actions::Base
Methods included from Actions::Update
Methods included from Actions::Create
Methods included from Actions::Fetch
Methods inherited from Base
Methods included from ResourceHelper
#resource_id, #resource_key, #resource_path, #resources
Constructor Details
This class inherits a constructor from Ribose::Base
Class Method Details
.all(calendar_id, options = {}) ⇒ Sawyer::Resource
List calendar events
14 15 16 |
# File 'lib/ribose/event.rb', line 14 def self.all(calendar_id, = {}) Ribose::Calendar.fetch(calendar_id, ) end |
.create(calendar_id, attrs, options = {}) ⇒ Sawyer::Resource
Create a calendar event
34 35 36 |
# File 'lib/ribose/event.rb', line 34 def self.create(calendar_id, attrs, = {}) new(.merge(calendar_id: calendar_id, **attrs)).create["events"] end |
.delete(calendar_id, event_id, options = {}) ⇒ Object
Delete a calendar event
57 58 59 |
# File 'lib/ribose/event.rb', line 57 def self.delete(calendar_id, event_id, = {}) new(.merge(calendar_id: calendar_id, resource_id: event_id)).delete end |
.fetch(calendar_id, event_id, options = {}) ⇒ Sawyer::Resource
Fetch a calendar event
24 25 26 |
# File 'lib/ribose/event.rb', line 24 def self.fetch(calendar_id, event_id, = {}) new(.merge(calendar_id: calendar_id, resource_id: event_id)).fetch end |
.update(calendar_id, event_id, attributes, options = {}) ⇒ Object
Update a calendar event
45 46 47 48 49 |
# File 'lib/ribose/event.rb', line 45 def self.update(calendar_id, event_id, attributes, = {}) new(.merge( calendar_id: calendar_id, resource_id: event_id, **attributes, )).update["events"] end |