Class: Tilia::Dav::Xml::Request::PropFind
- Includes:
- Xml::XmlDeserializable
- Defined in:
- lib/tilia/dav/xml/request/prop_find.rb
Overview
WebDAV PROPFIND request parser.
This class parses the DAV:propfind request, as defined in:
Instance Attribute Summary collapse
-
#all_prop ⇒ Object
If this is set to true, this was an ‘allprop’ request.
-
#properties ⇒ Object
The property list.
Class Method Summary collapse
-
.xml_deserialize(reader) ⇒ Object
The deserialize method is called during xml parsing.
Instance Method Summary collapse
-
#initialize ⇒ PropFind
constructor
TODO: document.
Constructor Details
#initialize ⇒ PropFind
TODO: document
63 64 65 |
# File 'lib/tilia/dav/xml/request/prop_find.rb', line 63 def initialize @all_prop = false end |
Instance Attribute Details
#all_prop ⇒ Object
If this is set to true, this was an ‘allprop’ request.
16 17 18 |
# File 'lib/tilia/dav/xml/request/prop_find.rb', line 16 def all_prop @all_prop end |
#properties ⇒ Object
The property list
21 22 23 |
# File 'lib/tilia/dav/xml/request/prop_find.rb', line 21 def properties @properties end |
Class Method Details
.xml_deserialize(reader) ⇒ Object
The deserialize method is called during xml parsing.
This method is called statictly, this is because in theory this method may be used as a type of constructor, or factory method.
Often you want to return an instance of the current class, but you are free to return other data as well.
You are responsible for advancing the reader to the next element. Not doing anything will result in a never-ending loop.
If you just want to skip parsing for this element altogether, you can just call reader.next
reader.parse_inner_tree will parse the entire sub-tree, and advance to the next element.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/tilia/dav/xml/request/prop_find.rb', line 42 def self.xml_deserialize(reader) instance = new reader.push_context reader.element_map['{DAV:}prop'] = Tilia::Xml::Element::Elements Tilia::Xml::Element::KeyValue.xml_deserialize(reader).each do |k, v| case k when '{DAV:}prop' instance.properties = v when '{DAV:}allprop' instance.all_prop = true end end reader.pop_context instance end |