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.
121 122 123 |
# File 'lib/groonga/client/response/select.rb', line 121 def drilldowns @drilldowns end |
#n_hits ⇒ Integer Also known as: total_count
Returns The number of records that match againt a search condition.
109 110 111 |
# File 'lib/groonga/client/response/select.rb', line 109 def n_hits @n_hits end |
#records ⇒ Object
Returns the value of attribute records.
112 113 114 |
# File 'lib/groonga/client/response/select.rb', line 112 def records @records end |
#slices ⇒ ::Hash<String, Groonga::Client::Response::Select::Slice>
126 127 128 |
# File 'lib/groonga/client/response/select.rb', line 126 def slices @slices end |
Instance Method Details
#body=(body) ⇒ Object
128 129 130 131 |
# File 'lib/groonga/client/response/select.rb', line 128 def body=(body) super(body) parse_body(body) end |
#each(&block) ⇒ Object
148 149 150 |
# File 'lib/groonga/client/response/select.rb', line 148 def each(&block) records.each(&block) end |
#limit_value ⇒ Object
For Kaminari
134 135 136 |
# File 'lib/groonga/client/response/select.rb', line 134 def limit_value (@command[:limit] || 10).to_i end |
#offset_value ⇒ Object
For Kaminari
139 140 141 |
# File 'lib/groonga/client/response/select.rb', line 139 def offset_value (@command[:offset] || 0).to_i end |
#size ⇒ Object
For Kaminari
144 145 146 |
# File 'lib/groonga/client/response/select.rb', line 144 def size records.size end |