Class: Droonga::Catalog::Generator::Dataset
- Inherits:
-
Object
- Object
- Droonga::Catalog::Generator::Dataset
- Defined in:
- lib/droonga/catalog/generator.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #fact ⇒ Object
-
#initialize(name, options) ⇒ Dataset
constructor
A new instance of Dataset.
- #n_workers ⇒ Object
- #plugins ⇒ Object
- #replicas ⇒ Object
- #schema ⇒ Object
- #to_catalog ⇒ Object
Constructor Details
#initialize(name, options) ⇒ Dataset
Returns a new instance of Dataset.
122 123 124 125 |
# File 'lib/droonga/catalog/generator.rb', line 122 def initialize(name, ) @name = name @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
120 121 122 |
# File 'lib/droonga/catalog/generator.rb', line 120 def name @name end |
Instance Method Details
#fact ⇒ Object
139 140 141 |
# File 'lib/droonga/catalog/generator.rb', line 139 def fact @options[:fact] end |
#n_workers ⇒ Object
127 128 129 |
# File 'lib/droonga/catalog/generator.rb', line 127 def n_workers @options[:n_workers] || DEFAULT_N_WORKERS end |
#plugins ⇒ Object
131 132 133 |
# File 'lib/droonga/catalog/generator.rb', line 131 def plugins @options[:plugins] || DEFAULT_PLUGINS end |
#replicas ⇒ Object
143 144 145 |
# File 'lib/droonga/catalog/generator.rb', line 143 def replicas @replicas ||= create_replicas end |
#schema ⇒ Object
135 136 137 |
# File 'lib/droonga/catalog/generator.rb', line 135 def schema @options[:schema] || {} end |
#to_catalog ⇒ Object
147 148 149 150 151 152 153 154 155 156 |
# File 'lib/droonga/catalog/generator.rb', line 147 def to_catalog catalog = { "nWorkers" => n_workers, "plugins" => plugins, "schema" => schema, "replicas" => replicas.to_catalog, } catalog["fact"] = fact if fact catalog end |