Module: FacebookGoogleCalendarSync::GoogleCalendarDescription

Included in:
GoogleCalendar, Synchroniser
Defined in:
lib/facebook_google_calendar_sync/google_calendar_description.rb

Constant Summary collapse

DESCRIPTION_PREFIX =
"Last known Facebook event update occurred at: "
DESCRIPTION_MIDDLE =
"\nFacebook last checked at: "
DESCRIPTION_SUFFIX =
"\nTo ensure calendar synchronises properly, please do not modify this description."

Instance Method Summary collapse

Instance Method Details

#create_description(last_known_event_update, now) ⇒ Object



13
14
15
# File 'lib/facebook_google_calendar_sync/google_calendar_description.rb', line 13

def create_description last_known_event_update, now
  "#{DESCRIPTION_PREFIX}#{last_known_event_update.to_s}#{DESCRIPTION_MIDDLE}#{now.to_s}#{DESCRIPTION_SUFFIX}"
end

#extract_last_modified_date(description) ⇒ Object



9
10
11
# File 'lib/facebook_google_calendar_sync/google_calendar_description.rb', line 9

def extract_last_modified_date description
  DateTime.strptime(description[DESCRIPTION_PREFIX.size..DESCRIPTION_PREFIX.size+25])
end