Class: Analysand::ViewResponse
Overview
A subclass of Response with additional view-specific accessors: total_rows, offset, and rows.
Instance Attribute Summary
Attributes inherited from Response
#body, #response
Instance Method Summary
collapse
Methods inherited from Response
#initialize
#code, #conflict?, #not_found?, #success?, #unauthorized?
#cookies, #etag, #session_cookie
Instance Method Details
#docs ⇒ Object
20
21
22
|
# File 'lib/analysand/view_response.rb', line 20
def docs
rows.map { |r| r['doc'] }.compact
end
|
#keys ⇒ Object
24
25
26
|
# File 'lib/analysand/view_response.rb', line 24
def keys
rows.map { |r| r['key'] }.compact
end
|
#offset ⇒ Object
12
13
14
|
# File 'lib/analysand/view_response.rb', line 12
def offset
body['offset']
end
|
#rows ⇒ Object
16
17
18
|
# File 'lib/analysand/view_response.rb', line 16
def rows
body['rows']
end
|
#total_rows ⇒ Object
8
9
10
|
# File 'lib/analysand/view_response.rb', line 8
def total_rows
body['total_rows']
end
|