class Tilia::CalDav::CalendarRoot

Calendars collection

This object is responsible for generating a list of calendar-homes for each user.

This is the top-most node for the calendars tree. In most servers this class represents the “/calendars” path.

Public Class Methods

new(principal_backend, caldav_backend, principal_prefix = 'principals') click to toggle source

Constructor

This constructor needs both an authentication and a caldav backend.

By default this class will show a list of calendar collections for principals in the 'principals' collection. If your main principals are actually located in a different path, use the principal_prefix argument to override this.

@param PrincipalBackendBackendInterface principal_backend @param BackendBackendInterface caldav_backend @param string principal_prefix

Calls superclass method
# File lib/tilia/cal_dav/calendar_root.rb, line 29
def initialize(principal_backend, caldav_backend, principal_prefix = 'principals')
  super(principal_backend, principal_prefix)
  @caldav_backend = caldav_backend
end

Public Instance Methods

child_for_principal(principal) click to toggle source

This method returns a node for a principal.

The passed array contains principal information, and is guaranteed to at least contain a uri item. Other properties may or may not be supplied by the authentication backend.

@param array principal @return SabreDAVINode

# File lib/tilia/cal_dav/calendar_root.rb, line 52
def child_for_principal(principal)
  CalendarHome.new(@caldav_backend, principal)
end
name() click to toggle source

Returns the nodename

We're overriding this, because the default will be the 'principalPrefix', and we want it to be SabreCalDAVPlugin::CALENDAR_ROOT

@return string

# File lib/tilia/cal_dav/calendar_root.rb, line 40
def name
  Plugin::CALENDAR_ROOT
end