Class: XCAPClient::Document
- Inherits:
-
Object
- Object
- XCAPClient::Document
- Defined in:
- lib/xcapclient/document.rb
Instance Attribute Summary collapse
-
#etag ⇒ Object
The last received ETag value in a response from the server.
-
#last_response ⇒ Object
The last response received from the server.
-
#name ⇒ Object
readonly
The name of the document as it exists in the server.
-
#parsed ⇒ Object
This attribute could contain the parsed instance of the XML document.
-
#plain ⇒ Object
Contains the plain document fetched from the server or manually set.
Instance Method Summary collapse
-
#initialize(name, plain = nil, etag = nil, parsed = nil) ⇒ Document
constructor
Create a new instance.
-
#reset ⇒ Object
Delete the local plain and parsed document and the ETag.
Constructor Details
#initialize(name, plain = nil, etag = nil, parsed = nil) ⇒ Document
Create a new instance. name, plain and etag are String.
21 22 23 24 25 26 27 28 29 |
# File 'lib/xcapclient/document.rb', line 21 def initialize(name, plain=nil, etag=nil, parsed=nil) @name = name @plain = plain @parsed = parsed @etag = etag # Check name. raise ConfigError, "Document `name' must be a non empty string" unless String === @name && ! @name.empty? end |
Instance Attribute Details
#etag ⇒ Object
The last received ETag value in a response from the server. It can be set manually.
12 13 14 |
# File 'lib/xcapclient/document.rb', line 12 def etag @etag end |
#last_response ⇒ Object
The last response received from the server. It’s a :Message object.
18 19 20 |
# File 'lib/xcapclient/document.rb', line 18 def last_response @last_response end |
#name ⇒ Object (readonly)
The name of the document as it exists in the server.
6 7 8 |
# File 'lib/xcapclient/document.rb', line 6 def name @name end |
#parsed ⇒ Object
This attribute could contain the parsed instance of the XML document. It’s not required by XCAPClient itself, but could be useful for the program in top of it.
15 16 17 |
# File 'lib/xcapclient/document.rb', line 15 def parsed @parsed end |
#plain ⇒ Object
Contains the plain document fetched from the server or manually set.
9 10 11 |
# File 'lib/xcapclient/document.rb', line 9 def plain @plain end |
Instance Method Details
#reset ⇒ Object
Delete the local plain and parsed document and the ETag.
32 33 34 35 36 |
# File 'lib/xcapclient/document.rb', line 32 def reset @plain = nil @parsed = nil @etag = nil end |