Class: Calendav::Calendar
- Inherits:
-
Object
- Object
- Calendav::Calendar
- Defined in:
- lib/calendav/calendar.rb
Constant Summary collapse
- ATTRIBUTES =
%i[ url display_name description ctag etag time_zone color components reports sync_token ].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Calendar
constructor
A new instance of Calendar.
- #to_h ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Calendar
Returns a new instance of Calendar.
23 24 25 |
# File 'lib/calendav/calendar.rb', line 23 def initialize(attributes = {}) @attributes = attributes end |
Class Method Details
.from_xml(host, node) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/calendav/calendar.rb', line 13 def self.from_xml(host, node) new( { url: ContextualURL.call(host, node.xpath("./dav:href").text) }.merge( Parsers::CalendarXML.call(node) ) ) end |
Instance Method Details
#to_h ⇒ Object
31 32 33 |
# File 'lib/calendav/calendar.rb', line 31 def to_h attributes.dup end |