Class: Net::DAV::Item::Props

Inherits:
Object
  • Object
show all
Defined in:
lib/net/dav/item.rb

Overview

Hold <response> XML element and provides facilities to query attributes

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject (readonly)

The <response> XML element


10
11
12
# File 'lib/net/dav/item.rb', line 10

def response
  @response
end

Instance Method Details

#contentlengthObject


25
26
27
# File 'lib/net/dav/item.rb', line 25

def contentlength
  @response./(".//x:getcontentlength", @namespaces).inner_text rescue nil
end

#contenttypeObject


21
22
23
# File 'lib/net/dav/item.rb', line 21

def contenttype
  @response./(".//x:getcontenttype", @namespaces).inner_text rescue nil
end

#creationdateObject


29
30
31
# File 'lib/net/dav/item.rb', line 29

def creationdate
  Time.parse(@response./(".//x:creationdate", @namespaces).inner_text)
end

#displaynameObject


17
18
19
# File 'lib/net/dav/item.rb', line 17

def displayname
  @response./(".//x:displayname", @namespaces).inner_text
end

#lastmodificationdateObject


33
34
35
# File 'lib/net/dav/item.rb', line 33

def lastmodificationdate
  Time.parse(@response./(".//x:getlastmodified", @namespaces).inner_text)
end