Module: Calendav

Defined in:
lib/calendav.rb,
lib/calendav/event.rb,
lib/calendav/client.rb,
lib/calendav/errors.rb,
lib/calendav/calendar.rb,
lib/calendav/endpoint.rb,
lib/calendav/namespaces.rb,
lib/calendav/error_handler.rb,
lib/calendav/contextual_url.rb,
lib/calendav/multi_response.rb,
lib/calendav/sync_collection.rb,
lib/calendav/parsers/sync_xml.rb,
lib/calendav/credentials/apple.rb,
lib/calendav/parsers/event_xml.rb,
lib/calendav/credentials/google.rb,
lib/calendav/credentials/fastmail.rb,
lib/calendav/credentials/standard.rb,
lib/calendav/parsers/calendar_xml.rb,
lib/calendav/parsers/response_xml.rb,
lib/calendav/requests/list_events.rb,
lib/calendav/clients/events_client.rb,
lib/calendav/requests/make_calendar.rb,
lib/calendav/requests/list_calendars.rb,
lib/calendav/clients/calendars_client.rb,
lib/calendav/requests/sync_collection.rb,
lib/calendav/requests/update_calendar.rb,
lib/calendav/requests/calendar_home_set.rb,
lib/calendav/requests/current_user_principal.rb

Defined Under Namespace

Modules: Clients, Credentials, Parsers, Requests Classes: Calendar, Client, ContextualURL, Endpoint, ErrorHandler, Event, MultiResponse, ParsingXMLError, RedirectError, RequestError, SyncCollection

Constant Summary collapse

PROVIDERS =
{
  apple: Credentials::Apple,
  fastmail: Credentials::FastMail,
  google: Credentials::Google
}.freeze
Error =
Class.new(StandardError)
PreconditionError =
Class.new(RequestError)
NAMESPACES =
{
  "xmlns:dav" => "DAV:",
  "xmlns:caldav" => "urn:ietf:params:xml:ns:caldav",
  "xmlns:cs" => "http://calendarserver.org/ns/",
  "xmlns:apple" => "http://apple.com/ns/ical/"
}.freeze

Class Method Summary collapse

Class Method Details

.client(credentials, timeout: nil) ⇒ Object



19
20
21
# File 'lib/calendav.rb', line 19

def self.client(credentials, timeout: nil)
  Client.new(credentials, timeout: timeout)
end

.credentials(provider, username, password) ⇒ Object



15
16
17
# File 'lib/calendav.rb', line 15

def self.credentials(provider, username, password)
  PROVIDERS.fetch(provider).new(username: username, password: password)
end