class Tilia::Dav::MkCol

This class represents a MKCOL operation.

MKCOL creates a new collection. MKCOL comes in two flavours:

  1. MKCOL with no body, signifies the creation of a simple collection.

  2. MKCOL with a request body. This can create a collection with a specific resource type, and a set of properties that should be set on the new collection. This can be used to create caldav calendars, carddav address books, etc.

Property updates must always be atomic. This means that a property update must either completely succeed, or completely fail.

Attributes

resource_type[RW]

A list of resource-types in clark-notation.

@var array

Public Class Methods

new(resource_type, mutations) click to toggle source

Creates the MKCOL object.

@param string[] resource_type List of resourcetype values. @param array mutations List of new properties values.

Calls superclass method
# File lib/tilia/dav/mk_col.rb, line 25
def initialize(resource_type, mutations)
  @resource_type = resource_type
  super(mutations)
end

Public Instance Methods

resource_type?(resource_type) click to toggle source

Returns true or false if the MKCOL operation has at least the specified resource type.

If the resourcetype is specified as an array, all resourcetypes are checked.

@param string|string[] resource_type

# File lib/tilia/dav/mk_col.rb, line 42
def resource_type?(resource_type)
  ([resource_type].flatten - @resource_type).size == 0
end