Class: GOM::Storage::CouchDB::Collection::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/gom/storage/couchdb/collection/fetcher.rb

Overview

Fetches a result-set of a CouchDB view and provides it to a GOM collection.

Instance Method Summary collapse

Constructor Details

#initialize(view, revisions, options) ⇒ Fetcher

Returns a new instance of Fetcher.



5
6
7
# File 'lib/gom/storage/couchdb/collection/fetcher.rb', line 5

def initialize(view, revisions, options)
  @view, @revisions, @options = view, revisions, options
end

Instance Method Details

#draftsObject



9
10
11
12
13
14
# File 'lib/gom/storage/couchdb/collection/fetcher.rb', line 9

def drafts
  return nil if @view.reduce
  fetch_collection
  fetch_drafts
  @drafts
end

#rowsObject



16
17
18
19
# File 'lib/gom/storage/couchdb/collection/fetcher.rb', line 16

def rows
  fetch_collection
  @collection
end