Class: Solr::CursorStream::Response

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/solr/cursorstream/response.rb

Overview

Wrapper around a Faraday::Response that provides sugar methods to get solr docs, numFound, and the cursor value

Instance Method Summary collapse

Constructor Details

#initialize(faraday_response) ⇒ Response



9
10
11
12
13
14
# File 'lib/solr/cursorstream/response.rb', line 9

def initialize(faraday_response)
  super
  @base_resp = faraday_response
  @resp = faraday_response.body
  __setobj__(@resp)
end

Instance Method Details

#cursorString



27
28
29
# File 'lib/solr/cursorstream/response.rb', line 27

def cursor
  @resp["nextCursorMark"]
end

#docsArray<Hash>



17
18
19
# File 'lib/solr/cursorstream/response.rb', line 17

def docs
  @resp["response"]["docs"]
end

#num_foundInteger



22
23
24
# File 'lib/solr/cursorstream/response.rb', line 22

def num_found
  @resp["response"]["numFound"]
end