Class: Net::DAV::Item::Props
- Inherits:
-
Object
- Object
- Net::DAV::Item::Props
- Defined in:
- lib/net/dav/item.rb
Overview
Hold <response> XML element and provides facilities to query attributes
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
The <response> XML element.
Instance Method Summary collapse
- #contentlength ⇒ Object
- #contenttype ⇒ Object
- #creationdate ⇒ Object
- #displayname ⇒ Object
-
#initialize(response) ⇒ Props
constructor
A new instance of Props.
- #lastmodificationdate ⇒ Object
Constructor Details
#initialize(response) ⇒ Props
Returns a new instance of Props.
12 13 14 15 |
# File 'lib/net/dav/item.rb', line 12 def initialize(response) @response = response @namespaces = {"x" => "DAV:"} end |
Instance Attribute Details
#response ⇒ Object (readonly)
The <response> XML element
10 11 12 |
# File 'lib/net/dav/item.rb', line 10 def response @response end |
Instance Method Details
#contentlength ⇒ Object
25 26 27 |
# File 'lib/net/dav/item.rb', line 25 def contentlength @response./(".//x:getcontentlength", @namespaces).inner_text rescue nil end |
#contenttype ⇒ Object
21 22 23 |
# File 'lib/net/dav/item.rb', line 21 def contenttype @response./(".//x:getcontenttype", @namespaces).inner_text rescue nil end |
#creationdate ⇒ Object
29 30 31 |
# File 'lib/net/dav/item.rb', line 29 def creationdate Time.parse(@response./(".//x:creationdate", @namespaces).inner_text) end |
#displayname ⇒ Object
17 18 19 |
# File 'lib/net/dav/item.rb', line 17 def displayname @response./(".//x:displayname", @namespaces).inner_text end |
#lastmodificationdate ⇒ Object
33 34 35 |
# File 'lib/net/dav/item.rb', line 33 def lastmodificationdate Time.parse(@response./(".//x:getlastmodified", @namespaces).inner_text) end |