Class: Droonga::Catalog::Generator::Replica
- Inherits:
-
Object
- Object
- Droonga::Catalog::Generator::Replica
- Defined in:
- lib/droonga/catalog/generator.rb
Instance Method Summary collapse
-
#initialize(host, options = {}) ⇒ Replica
constructor
A new instance of Replica.
- #to_catalog ⇒ Object
Constructor Details
#initialize(host, options = {}) ⇒ Replica
Returns a new instance of Replica.
209 210 211 212 213 214 |
# File 'lib/droonga/catalog/generator.rb', line 209 def initialize(host, ={}) @host = host @port = [:port] || DEFAULT_PORT @tag = [:tag] || DEFAULT_TAG @n_slices = [:n_slices] || DEFAULT_N_SLICES end |
Instance Method Details
#to_catalog ⇒ Object
216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/droonga/catalog/generator.rb', line 216 def to_catalog slices = [] @n_slices.times do |i| slices << catalog_slice(i) end { "dimension" => "_key", "slicer" => "hash", "slices" => slices, } end |