Sha256: 812032aad3ba4f0f9bbe03e33110bca3814b410c8196b42ff00630cf06c66148
Contents?: true
Size: 947 Bytes
Versions: 5
Compression:
Stored size: 947 Bytes
Contents
require "date" module Ribose class Calendar < Ribose::Base include Ribose::Actions::All include Ribose::Actions::Fetch include Ribose::Actions::Create include Ribose::Actions::Delete # Fetch calendar events # # @params calendar_ids [Array] List of calendar Ids # @params start [Date] The start date to fetch events # @params length [Integer] How many days to fetch # @return [Sawyer::Resource] The calendar events # 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 private def resource "calendar" end def resources_path "calendar/calendar" end def validate(name:, **attributes) attributes.merge(name: name) end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
ribose-0.5.0 | lib/ribose/calendar.rb |
ribose-0.4.1 | lib/ribose/calendar.rb |
ribose-0.4.0 | lib/ribose/calendar.rb |
ribose-0.3.2 | lib/ribose/calendar.rb |
ribose-0.3.1 | lib/ribose/calendar.rb |