Class: GOM::Storage::CouchDB::Fetcher
- Inherits:
-
Object
- Object
- GOM::Storage::CouchDB::Fetcher
- Defined in:
- lib/gom/storage/couchdb/fetcher.rb
Overview
Fetches a CouchDB document with the given id and returns a draft.
Instance Attribute Summary collapse
-
#database ⇒ Object
Returns the value of attribute database.
-
#id ⇒ Object
Returns the value of attribute id.
-
#revisions ⇒ Object
Returns the value of attribute revisions.
Instance Method Summary collapse
- #draft ⇒ Object
-
#initialize(database, id, revisions) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(database, id, revisions) ⇒ Fetcher
Returns a new instance of Fetcher.
9 10 11 |
# File 'lib/gom/storage/couchdb/fetcher.rb', line 9 def initialize(database, id, revisions) @database, @id, @revisions = database, id, revisions end |
Instance Attribute Details
#database ⇒ Object
Returns the value of attribute database.
5 6 7 |
# File 'lib/gom/storage/couchdb/fetcher.rb', line 5 def database @database end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/gom/storage/couchdb/fetcher.rb', line 6 def id @id end |
#revisions ⇒ Object
Returns the value of attribute revisions.
7 8 9 |
# File 'lib/gom/storage/couchdb/fetcher.rb', line 7 def revisions @revisions end |
Instance Method Details
#draft ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/gom/storage/couchdb/fetcher.rb', line 13 def draft initialize_document load_document build_draft @draft rescue ::CouchDB::Document::NotFoundError nil end |