Class: Ribose::Calendar

Inherits:
Base
  • Object
show all
Includes:
Actions::All, Actions::Create, Actions::Delete, Actions::Fetch
Defined in:
lib/ribose/calendar.rb

Class Method Summary collapse

Methods included from Actions::Delete

#delete

Methods included from Actions::Base

#included

Methods included from Actions::Create

#create

Methods included from Actions::Fetch

#fetch

Methods included from Actions::All

#all

Methods inherited from Base

#initialize

Methods included from ResourceHelper

#resource_id, #resource_key, #resource_path, #resources

Constructor Details

This class inherits a constructor from Ribose::Base

Class Method Details

.fetch(calendar_ids, start: Date.today, length: 7, **others) ⇒ Sawyer::Resource

Fetch calendar events

Returns:

  • (Sawyer::Resource)

    The calendar events



17
18
19
20
21
22
23
24
25
# File 'lib/ribose/calendar.rb', line 17

def self.fetch(calendar_ids, start: Date.today, length: 7, **others)
  query = {
    length: length,
    cal_ids: Ribose.encode_ids(calendar_ids),
    start: start.to_time.to_i / (60 * 60 * 24),
  }

  super(nil, query: others.merge(query))
end