Class: Droonga::Catalog::Dataset
- Inherits:
-
Object
- Object
- Droonga::Catalog::Dataset
- Defined in:
- lib/droonga/catalog/dataset.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#[](key) ⇒ Object
provided for compatibility.
-
#[]=(key, value) ⇒ Object
provided for compatibility.
- #fact ⇒ Object
-
#initialize(name, data) ⇒ Dataset
constructor
A new instance of Dataset.
- #n_workers ⇒ Object
- #plugins ⇒ Object
- #replicas ⇒ Object
- #schema ⇒ Object
Constructor Details
#initialize(name, data) ⇒ Dataset
25 26 27 28 29 |
# File 'lib/droonga/catalog/dataset.rb', line 25 def initialize(name, data) @name = name @data = data @schema = nil end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/droonga/catalog/dataset.rb', line 23 def name @name end |
Instance Method Details
#[](key) ⇒ Object
provided for compatibility
32 33 34 |
# File 'lib/droonga/catalog/dataset.rb', line 32 def [](key) @data[key] end |
#[]=(key, value) ⇒ Object
provided for compatibility
37 38 39 |
# File 'lib/droonga/catalog/dataset.rb', line 37 def []=(key, value) @data[key] = value end |
#fact ⇒ Object
49 50 51 |
# File 'lib/droonga/catalog/dataset.rb', line 49 def fact @data["fact"] end |
#n_workers ⇒ Object
53 54 55 |
# File 'lib/droonga/catalog/dataset.rb', line 53 def n_workers @data["nWorkers"] || 0 end |
#plugins ⇒ Object
45 46 47 |
# File 'lib/droonga/catalog/dataset.rb', line 45 def plugins @data["plugins"] || [] end |
#replicas ⇒ Object
57 58 59 |
# File 'lib/droonga/catalog/dataset.rb', line 57 def replicas @replicas ||= VolumeCollection.new(create_volumes(@data["replicas"])) end |
#schema ⇒ Object
41 42 43 |
# File 'lib/droonga/catalog/dataset.rb', line 41 def schema @schema ||= Schema.new(@name, @data["schema"]) end |