class Tilia::CardDav::AddressBookRoot

AddressBook rootnode

This object lists a collection of users, which can contain addressbooks.

Attributes

carddav_backend[RW]

CardDAV backend

@var BackendBackendInterface

principal_backend[RW]

Principal Backend

@var SabreDAVACLPrincipalBackendBackendInteface

Public Class Methods

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

Constructor

This constructor needs both a principal and a carddav backend.

By default this class will show a list of addressbook 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 DAVACLPrincipalBackendBackendInterface principal_backend @param BackendBackendInterface carddav_backend @param string principal_prefix

Calls superclass method
# File lib/tilia/card_dav/address_book_root.rb, line 33
def initialize(principal_backend, carddav_backend, principal_prefix = 'principals')
  @carddav_backend = carddav_backend
  super(principal_backend, principal_prefix)
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/card_dav/address_book_root.rb, line 53
def child_for_principal(principal)
  AddressBookHome.new(@carddav_backend, principal['uri'])
end
name() click to toggle source

Returns the name of the node

@return string

# File lib/tilia/card_dav/address_book_root.rb, line 41
def name
  Plugin::ADDRESSBOOK_ROOT
end