Class: Groonga::Client::Response::Select
- Includes:
- Enumerable
- Defined in:
- lib/groonga/client/response/select.rb
Defined Under Namespace
Classes: Drilldown, Record, Slice
Instance Attribute Summary collapse
-
#drilldowns ⇒ ::Array<Groonga::Client::Response::Select::Drilldown>, ::Hash<String, Groonga::Client::Response::Select::Drilldown>
If labeled drilldowns are used or command version 3 or later is used,
{"label1" => drilldown1, "label2" => drilldown2}
is returned since 0.3.1. -
#n_hits ⇒ Integer
(also: #total_count)
The number of records that match againt a search condition.
-
#records ⇒ Object
Returns the value of attribute records.
- #slices ⇒ ::Hash<String, Groonga::Client::Response::Select::Slice>
Attributes inherited from Base
#body, #command, #header, #raw
Instance Method Summary collapse
- #body=(body) ⇒ Object
- #each(&block) ⇒ Object
-
#limit_value ⇒ Object
For Kaminari.
-
#offset_value ⇒ Object
For Kaminari.
-
#size ⇒ Object
For Kaminari.
Methods inherited from Base
#elapsed_time, #error_message, #initialize, parse, #return_code, #start_time, #status_code, #success?
Constructor Details
This class inherits a constructor from Groonga::Client::Response::Base
Instance Attribute Details
#drilldowns ⇒ ::Array<Groonga::Client::Response::Select::Drilldown>, ::Hash<String, Groonga::Client::Response::Select::Drilldown>
If labeled drilldowns are used or command version 3 or
later is used, {"label1" => drilldown1, "label2" => drilldown2}
is returned since 0.3.1.
Otherwise, [drilldown1, drilldown2]
is returned.
193 194 195 |
# File 'lib/groonga/client/response/select.rb', line 193 def drilldowns @drilldowns end |
#n_hits ⇒ Integer Also known as: total_count
Returns The number of records that match againt a search condition.
181 182 183 |
# File 'lib/groonga/client/response/select.rb', line 181 def n_hits @n_hits end |
#records ⇒ Object
Returns the value of attribute records.
184 185 186 |
# File 'lib/groonga/client/response/select.rb', line 184 def records @records end |
#slices ⇒ ::Hash<String, Groonga::Client::Response::Select::Slice>
198 199 200 |
# File 'lib/groonga/client/response/select.rb', line 198 def slices @slices end |
Instance Method Details
#body=(body) ⇒ Object
200 201 202 203 |
# File 'lib/groonga/client/response/select.rb', line 200 def body=(body) super(body) parse_body(body) end |
#each(&block) ⇒ Object
220 221 222 |
# File 'lib/groonga/client/response/select.rb', line 220 def each(&block) records.each(&block) end |
#limit_value ⇒ Object
For Kaminari
206 207 208 |
# File 'lib/groonga/client/response/select.rb', line 206 def limit_value (@command[:limit] || 10).to_i end |
#offset_value ⇒ Object
For Kaminari
211 212 213 |
# File 'lib/groonga/client/response/select.rb', line 211 def offset_value (@command[:offset] || 0).to_i end |
#size ⇒ Object
For Kaminari
216 217 218 |
# File 'lib/groonga/client/response/select.rb', line 216 def size records.size end |