Class: Viewpoint::EWS::CalendarFolder
- Inherits:
-
GenericFolder
- Object
- GenericFolder
- Viewpoint::EWS::CalendarFolder
- Defined in:
- lib/model/calendar_folder.rb
Instance Attribute Summary
Attributes inherited from GenericFolder
#change_key, #folder_id, #parent_id, #subscription_id, #sync_state, #watermark
Attributes included from Model
#ews_methods, #ews_methods_undef
Class Method Summary collapse
-
.find_folders(root = :msgfolderroot, traversal = 'Deep', shape = 'Default', folder_type = 'IPF.Appointment') ⇒ Array
Find folders of type Task.
Instance Method Summary collapse
-
#initialize(folder) ⇒ CalendarFolder
constructor
initialize with an item of CalendarFolderType.
-
#items_between(start_date, end_date, opts = {}) ⇒ Object
Find Calendar Items between two dates.
-
#items_since(start_date_time, opts = {}) ⇒ Object
Fetch items since a give DateTime.
-
#todays_items(opts = {}) ⇒ Object
Fetch only items from today (since midnight).
Methods inherited from GenericFolder
#add_subfolder, #clear_sync_state!, #delete!, #find_items, folder_names, #get_events, get_folder, get_folder_by_name, get_folder_by_path, #get_item, #get_items, #search_by_subject, #subscribe, #subscribed?, #sync_items!, #sync_items_since!, #unsubscribe
Constructor Details
#initialize(folder) ⇒ CalendarFolder
initialize with an item of CalendarFolderType
37 38 39 40 41 42 |
# File 'lib/model/calendar_folder.rb', line 37 def initialize(folder) super(folder) # @todo Handle: # <SharingEffectiveRights/> end |
Class Method Details
.find_folders(root = :msgfolderroot, traversal = 'Deep', shape = 'Default', folder_type = 'IPF.Appointment') ⇒ Array
Find folders of type Task
31 32 33 |
# File 'lib/model/calendar_folder.rb', line 31 def self.find_folders(root = :msgfolderroot, traversal = 'Deep', shape = 'Default', folder_type = 'IPF.Appointment') super(root, traversal, shape, folder_type) end |
Instance Method Details
#items_between(start_date, end_date, opts = {}) ⇒ Object
Find Calendar Items between two dates
60 61 62 63 |
# File 'lib/model/calendar_folder.rb', line 60 def items_between(start_date, end_date, opts = {}) opts[:calendar_view] = {:max_entries_returned => 256, :start_date => start_date, :end_date => end_date} find_items(opts) end |
#items_since(start_date_time, opts = {}) ⇒ Object
Fetch items since a give DateTime
52 53 54 |
# File 'lib/model/calendar_folder.rb', line 52 def items_since(start_date_time, opts = {}) items_between(start_date_time, DateTime.now, opts) end |
#todays_items(opts = {}) ⇒ Object
Fetch only items from today (since midnight)
45 46 47 48 |
# File 'lib/model/calendar_folder.rb', line 45 def todays_items(opts = {}) #This is a bit convoluted for pre-1.9.x ruby versions that don't support to_datetime items_between(DateTime.parse(Date.today.to_s), DateTime.parse((Date.today + 1).to_s), opts) end |