Class: SabredavClient::XmlRequestBuilder::Mkcalendar

Inherits:
Base
  • Object
show all
Defined in:
lib/sabredav_client/xml_request_builder/mkcalendar.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#xml

Instance Method Summary collapse

Constructor Details

#initialize(displayname = nil, description = nil) ⇒ Mkcalendar

Returns a new instance of Mkcalendar.



7
8
9
10
11
# File 'lib/sabredav_client/xml_request_builder/mkcalendar.rb', line 7

def initialize(displayname = nil, description = nil)
  @displayname = displayname
  @description = description
  super()
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/sabredav_client/xml_request_builder/mkcalendar.rb', line 5

def description
  @description
end

#displaynameObject

Returns the value of attribute displayname.



5
6
7
# File 'lib/sabredav_client/xml_request_builder/mkcalendar.rb', line 5

def displayname
  @displayname
end

Instance Method Details

#to_xmlObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/sabredav_client/xml_request_builder/mkcalendar.rb', line 13

def to_xml
  xml.c :mkcalendar, C_NAMESPACES do
    xml.d :set do
      xml.d :prop do
        xml.d :displayname, displayname unless displayname.to_s.empty?
        xml.tag! "c:calendar-description", description, "xml:lang" => "en" unless description.to_s.empty?
      end
    end
  end
end