Class: CalDAV::Calendar
- Inherits:
-
Object
- Object
- CalDAV::Calendar
- Defined in:
- lib/CalDAV/Calendar.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#ctag ⇒ Object
readonly
Returns the value of attribute ctag.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#supported_components ⇒ Object
readonly
Returns the value of attribute supported_components.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
Class Method Summary collapse
-
.all(client:, home: nil) ⇒ Object
Discovers the calendars in a home collection and returns them as Calendars — the high-level, object-returning entry point.
-
.from_resource(resource) ⇒ Object
Builds a Calendar from a CalDAV::Resource (as returned by a calendar-home PROPFIND).
Instance Method Summary collapse
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
8 9 10 |
# File 'lib/CalDAV/Calendar.rb', line 8 def color @color end |
#ctag ⇒ Object (readonly)
Returns the value of attribute ctag.
8 9 10 |
# File 'lib/CalDAV/Calendar.rb', line 8 def ctag @ctag end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/CalDAV/Calendar.rb', line 8 def description @description end |
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
8 9 10 |
# File 'lib/CalDAV/Calendar.rb', line 8 def display_name @display_name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/CalDAV/Calendar.rb', line 8 def path @path end |
#supported_components ⇒ Object (readonly)
Returns the value of attribute supported_components.
8 9 10 |
# File 'lib/CalDAV/Calendar.rb', line 8 def supported_components @supported_components end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
8 9 10 |
# File 'lib/CalDAV/Calendar.rb', line 8 def timezone @timezone end |
Class Method Details
.all(client:, home: nil) ⇒ Object
Discovers the calendars in a home collection and returns them as Calendars — the high-level, object-returning entry point. The CalDAV client stays the low-level path for anyone wanting the raw resources. home defaults to the client's discovered calendar-home-set.
22 23 24 |
# File 'lib/CalDAV/Calendar.rb', line 22 def all(client:, home: nil) load(client: client, home: home) end |
.from_resource(resource) ⇒ Object
Builds a Calendar from a CalDAV::Resource (as returned by a calendar-home PROPFIND). Strictly a mapping over the resource's navigation accessors — no parsing. ctag and color are read opportunistically: populated only when the extension accessors are loaded (require 'CalDAV/Objects' pulls them in; 'CalDAV/Objects/Core' does not), and nil otherwise.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/CalDAV/Calendar.rb', line 31 def from_resource(resource) new( path: resource.href, display_name: resource.display_name, ctag: (resource.getctag if resource.respond_to?(:getctag)), color: (resource.calendar_color if resource.respond_to?(:calendar_color)), description: resource.calendar_description, timezone: resource.calendar_timezone, supported_components: resource.supported_calendar_component_set ) end |
Instance Method Details
#to_s ⇒ Object
51 52 53 |
# File 'lib/CalDAV/Calendar.rb', line 51 def to_s display_name || path end |