Skip to content

Commit

Permalink
Reformat CalendarItem params, make start/end return DateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
zenchild committed Apr 2, 2014
1 parent 1aafe67 commit 9c9d713
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/ews/types/calendar_item.rb
Expand Up @@ -9,28 +9,30 @@ class CalendarItem
recurring?: [:is_recurring, :text],
meeting?: [:is_meeting, :text],
cancelled?: [:is_cancelled, :text],
duration: [:duration, :text],
time_zone: [:time_zone, :text],
start: [:start, :text],
end: [:end, :text],
location: [:location, :text],
all_day?: [:is_all_day_event, :text],
duration: [:duration, :text],
time_zone: [:time_zone, :text],
start: [:start, :text],
end: [:end, :text],
location: [:location, :text],
all_day?: [:is_all_day_event, :text],
my_response_type: [:my_response_type, :text],
organizer: [:organizer, :elems, 0, :mailbox, :elems],
optional_attendees: [:optional_attendees, :elems ],
required_attendees: [:required_attendees, :elems ],
recurrence: [:recurrence, :elems ],
deleted_occurrences: [:deleted_occurrences, :elems ],
modified_occurrences: [:modified_occurrences, :elems ],
has_attachments?: [:has_attachments, :text ],
attachments: [:attachments, :elems ]
modified_occurrences: [:modified_occurrences, :elems ]
}

CALENDAR_ITEM_KEY_TYPES = {
start: ->(str){DateTime.parse(str)},
end: ->(str){DateTime.parse(str)},
recurring?: ->(str){str.downcase == 'true'},
meeting?: ->(str){str.downcase == 'true'},
cancelled?: ->(str){str.downcase == 'true'},
all_day?: ->(str){str.downcase == 'true'},
all_day?: ->(str){str.downcase == 'true'},
organizer: :build_mailbox_user,
optional_attendees: :build_attendees_users,
required_attendees: :build_attendees_users,
deleted_occurrences: :build_deleted_occurrences,
modified_occurrences: :build_modified_occurrences
Expand Down

0 comments on commit 9c9d713

Please sign in to comment.