class Calendav::Requests::UpdateCalendar

Attributes

attributes[R]

Public Class Methods

call(...) click to toggle source
# File lib/calendav/requests/update_calendar.rb, line 10
def self.call(...)
  new(...).call
end
new(attributes) click to toggle source
# File lib/calendav/requests/update_calendar.rb, line 14
def initialize(attributes)
  @attributes = attributes
end

Public Instance Methods

call() click to toggle source
# File lib/calendav/requests/update_calendar.rb, line 18
def call
  Nokogiri::XML::Builder.new do |xml|
    xml["dav"].propertyupdate(NAMESPACES) do
      xml["dav"].set do
        xml["dav"].prop do
          xml["dav"].displayname display_name if display_name

          if description
            xml["caldav"].public_send(
              :"calendar-description", description
            )
          end

          if time_zone
            xml["caldav"].public_send(:"calendar-timezone", time_zone)
          end

          xml["apple"].public_send(:"calendar-color", color) if color
        end
      end
    end
  end
end

Private Instance Methods

color() click to toggle source
# File lib/calendav/requests/update_calendar.rb, line 46
def color
  attributes[:color]
end
description() click to toggle source
# File lib/calendav/requests/update_calendar.rb, line 54
def description
  attributes[:description]
end
display_name() click to toggle source
# File lib/calendav/requests/update_calendar.rb, line 50
def display_name
  attributes[:display_name]
end
time_zone() click to toggle source
# File lib/calendav/requests/update_calendar.rb, line 58
def time_zone
  attributes[:time_zone]
end