Class: Droonga::CatalogGenerator::Dataset
- Inherits:
-
Object
- Object
- Droonga::CatalogGenerator::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.
121 122 123 124 |
# File 'lib/droonga/catalog_generator.rb', line 121 def initialize(name, ) @name = name @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
119 120 121 |
# File 'lib/droonga/catalog_generator.rb', line 119 def name @name end |
Instance Method Details
#fact ⇒ Object
138 139 140 |
# File 'lib/droonga/catalog_generator.rb', line 138 def fact @options[:fact] end |
#n_workers ⇒ Object
126 127 128 |
# File 'lib/droonga/catalog_generator.rb', line 126 def n_workers @options[:n_workers] || DEFAULT_N_WORKERS end |
#plugins ⇒ Object
130 131 132 |
# File 'lib/droonga/catalog_generator.rb', line 130 def plugins @options[:plugins] || DEFAULT_PLUGINS end |
#replicas ⇒ Object
142 143 144 |
# File 'lib/droonga/catalog_generator.rb', line 142 def replicas @replicas ||= create_replicas end |
#schema ⇒ Object
134 135 136 |
# File 'lib/droonga/catalog_generator.rb', line 134 def schema @options[:schema] || {} end |
#to_catalog ⇒ Object
146 147 148 149 150 151 152 153 154 155 |
# File 'lib/droonga/catalog_generator.rb', line 146 def to_catalog catalog = { "nWorkers" => n_workers, "plugins" => plugins, "schema" => schema, "replicas" => replicas.to_catalog, } catalog["fact"] = fact if fact catalog end |