class SabredavClient::XmlRequestBuilder::PROPFINDCalendar

Constants

PROPERTIES

Attributes

properties[R]

Public Class Methods

new(properties:) click to toggle source
# File lib/sabredav_client/xml_request_builder/propfind_calendar.rb, line 12
def initialize(properties:)
  @properties = properties
  super()
end

Public Instance Methods

build_properties() click to toggle source
# File lib/sabredav_client/xml_request_builder/propfind_calendar.rb, line 25
def build_properties
  properties.each do |property|
    raise SabredavClient::Errors::PropertyNotSupportedError, "Known properties are #{PROPERTIES}" unless PROPERTIES.keys.include?(property)

    readable_property = property.to_s.gsub('_', '-').to_sym

    case PROPERTIES[property]
    when :d
      xml.d readable_property
    when :cs
      xml.cs readable_property
    end
  end
end
to_xml() click to toggle source
# File lib/sabredav_client/xml_request_builder/propfind_calendar.rb, line 17
def to_xml
  xml.d :propfind, CS_NAMESPACES do
    xml.d :prop do
      build_properties
    end
  end
end