Class: Calendav::Event
- Inherits:
-
Object
- Object
- Calendav::Event
- Defined in:
- lib/calendav/event.rb
Constant Summary collapse
- ATTRIBUTES =
%i[url calendar_data etag].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #dtend ⇒ Object
- #dtstart ⇒ Object
-
#initialize(attributes = {}) ⇒ Event
constructor
A new instance of Event.
- #location ⇒ Object
- #summary ⇒ Object
- #to_h ⇒ Object
- #unloaded? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Event
Returns a new instance of Event.
20 21 22 |
# File 'lib/calendav/event.rb', line 20 def initialize(attributes = {}) @attributes = attributes end |
Class Method Details
.from_xml(host, node) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/calendav/event.rb', line 10 def self.from_xml(host, node) new( { url: ContextualURL.call(host, node.xpath("./dav:href").text) }.merge( Parsers::EventXML.call(node) ) ) end |
Instance Method Details
#dtend ⇒ Object
44 45 46 |
# File 'lib/calendav/event.rb', line 44 def dtend inner_event.dtend end |
#dtstart ⇒ Object
40 41 42 |
# File 'lib/calendav/event.rb', line 40 def dtstart inner_event.dtstart end |
#location ⇒ Object
36 37 38 |
# File 'lib/calendav/event.rb', line 36 def location inner_event.location end |
#summary ⇒ Object
32 33 34 |
# File 'lib/calendav/event.rb', line 32 def summary inner_event.summary end |
#to_h ⇒ Object
28 29 30 |
# File 'lib/calendav/event.rb', line 28 def to_h attributes.dup end |
#unloaded? ⇒ Boolean
48 49 50 |
# File 'lib/calendav/event.rb', line 48 def unloaded? calendar_data.nil? end |