Class: Net::DAV::Item
- Inherits:
-
Object
- Object
- Net::DAV::Item
- Defined in:
- lib/net/dav/item.rb
Overview
Hold items found using Net::DAV#find
Defined Under Namespace
Classes: Props
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Properties holder.
-
#size ⇒ Object
readonly
Size of item if a file.
-
#type ⇒ Object
readonly
Type of item - :directory or :file.
-
#uri ⇒ Object
readonly
URI of item.
Instance Method Summary collapse
-
#content ⇒ Object
Get content from server if needed and return as string.
-
#content=(str) ⇒ Object
Put content to server.
-
#initialize(dav, uri, type, size, properties) ⇒ Item
constructor
:nodoc:.
-
#inspect ⇒ Object
:nodoc:.
-
#propfind ⇒ Object
Properties for this item.
-
#proppatch(xml_snippet) ⇒ Object
Proppatch item.
-
#to_s ⇒ Object
:nodoc:.
-
#url ⇒ Object
Synonym for uri.
Constructor Details
Instance Attribute Details
#properties ⇒ Object (readonly)
Properties holder
49 50 51 |
# File 'lib/net/dav/item.rb', line 49 def properties @properties end |
#size ⇒ Object (readonly)
Size of item if a file
43 44 45 |
# File 'lib/net/dav/item.rb', line 43 def size @size end |
#type ⇒ Object (readonly)
Type of item - :directory or :file
46 47 48 |
# File 'lib/net/dav/item.rb', line 46 def type @type end |
#uri ⇒ Object (readonly)
URI of item
40 41 42 |
# File 'lib/net/dav/item.rb', line 40 def uri @uri end |
Instance Method Details
#content ⇒ Object
Get content from server if needed and return as string
65 66 67 68 |
# File 'lib/net/dav/item.rb', line 65 def content return @content unless @content.nil? @content = @dav.get(@uri.path) end |
#content=(str) ⇒ Object
Put content to server
71 72 73 74 |
# File 'lib/net/dav/item.rb', line 71 def content=(str) @dav.put_string(@uri.path, str) @content = str end |
#inspect ⇒ Object
:nodoc:
90 91 92 |
# File 'lib/net/dav/item.rb', line 90 def inspect #:nodoc: "#<Net::DAV::Item URL:#{@uri.to_s} type:#{@type}>" end |
#propfind ⇒ Object
Properties for this item
82 83 84 |
# File 'lib/net/dav/item.rb', line 82 def propfind return @dav.propfind(@uri.path) end |
#proppatch(xml_snippet) ⇒ Object
Proppatch item
77 78 79 |
# File 'lib/net/dav/item.rb', line 77 def proppatch(xml_snippet) @dav.proppatch(@uri.path,xml_snippet) end |
#to_s ⇒ Object
:nodoc:
86 87 88 |
# File 'lib/net/dav/item.rb', line 86 def to_s #:nodoc: "#<Net::DAV::Item URL:#{@uri.to_s} type:#{@type}>" end |
#url ⇒ Object
Synonym for uri
52 53 54 |
# File 'lib/net/dav/item.rb', line 52 def url @uri end |