Class: Calendav::Todo
- Inherits:
-
Object
- Object
- Calendav::Todo
- Defined in:
- lib/calendav/todo.rb
Constant Summary collapse
- ATTRIBUTES =
%i[url calendar_data etag].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #due ⇒ Object
-
#initialize(attributes = {}) ⇒ Todo
constructor
A new instance of Todo.
- #status ⇒ Object
- #summary ⇒ Object
- #to_h ⇒ Object
- #unloaded? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Todo
Returns a new instance of Todo.
20 21 22 |
# File 'lib/calendav/todo.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/todo.rb', line 10 def self.from_xml(host, node) new( { url: ContextualURL.call(host, node.xpath("./dav:href").text) }.merge( Parsers::TodoXML.call(node) ) ) end |
Instance Method Details
#due ⇒ Object
36 37 38 |
# File 'lib/calendav/todo.rb', line 36 def due inner_todo.due end |
#status ⇒ Object
40 41 42 |
# File 'lib/calendav/todo.rb', line 40 def status inner_todo.status end |
#summary ⇒ Object
32 33 34 |
# File 'lib/calendav/todo.rb', line 32 def summary inner_todo.summary end |
#to_h ⇒ Object
28 29 30 |
# File 'lib/calendav/todo.rb', line 28 def to_h attributes.dup end |
#unloaded? ⇒ Boolean
44 45 46 |
# File 'lib/calendav/todo.rb', line 44 def unloaded? calendar_data.nil? end |