Class: Droonga::Catalog::Base
- Inherits:
-
Object
- Object
- Droonga::Catalog::Base
- Defined in:
- lib/droonga/catalog/base.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #cluster_id ⇒ Object
- #dataset(name) ⇒ Object
- #have_dataset?(name) ⇒ Boolean
-
#initialize(raw, path) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(raw, path) ⇒ Base
Returns a new instance of Base.
27 28 29 30 31 |
# File 'lib/droonga/catalog/base.rb', line 27 def initialize(raw, path) @raw = raw @path = path || "/tmp/temporary-catalog.json" @base_path = File.dirname(@path) end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
26 27 28 |
# File 'lib/droonga/catalog/base.rb', line 26 def base_path @base_path end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
26 27 28 |
# File 'lib/droonga/catalog/base.rb', line 26 def path @path end |
Instance Method Details
#cluster_id ⇒ Object
41 42 43 |
# File 'lib/droonga/catalog/base.rb', line 41 def cluster_id @cluster_id ||= calculate_cluster_id end |
#dataset(name) ⇒ Object
37 38 39 |
# File 'lib/droonga/catalog/base.rb', line 37 def dataset(name) datasets[name] end |
#have_dataset?(name) ⇒ Boolean
33 34 35 |
# File 'lib/droonga/catalog/base.rb', line 33 def have_dataset?(name) datasets.key?(name) end |