Class: Droonga::Catalog::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/catalog/base.rb

Direct Known Subclasses

Version1, Version2

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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

#pathObject (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_idObject



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

Returns:

  • (Boolean)


33
34
35
# File 'lib/droonga/catalog/base.rb', line 33

def have_dataset?(name)
  datasets.key?(name)
end