class Tilia::CalDav::Xml::Property::AllowedSharingModes

AllowedSharingModes

This property encodes the 'allowed-sharing-modes' property, as defined by the 'caldav-sharing-02' spec, in the calendarserver.org/ns/ namespace.

This property is a representation of the supported-calendar_component-set property in the CalDAV namespace. It simply requires an array of components, such as VEVENT, VTODO

Public Class Methods

new(can_be_shared, can_be_published) click to toggle source

Constructor

@param bool can_be_shared @param bool can_be_published @return void

# File lib/tilia/cal_dav/xml/property/allowed_sharing_modes.rb, line 34
def initialize(can_be_shared, can_be_published)
  @can_be_shared = can_be_shared
  @can_be_published = can_be_published
end

Public Instance Methods

xml_serialize(writer) click to toggle source

The xmlSerialize metod is called during xml writing.

Use the writer argument to write its own xml serialization.

An important note: do not create a parent element. Any element implementing XmlSerializble should only ever write what's considered its 'inner xml'.

The parent of the current element is responsible for writing a containing element.

This allows serializers to be re-used for different element names.

If you are opening new elements, you must also close them again.

@param Writer writer @return void

# File lib/tilia/cal_dav/xml/property/allowed_sharing_modes.rb, line 56
def xml_serialize(writer)
  writer.write_element("{#{Plugin::NS_CALENDARSERVER}}can-be-shared") if @can_be_shared
  writer.write_element("{#{Plugin::NS_CALENDARSERVER}}can-be-published") if @can_be_published
end