Class: KyotoCabinet::Db::FileHash

Inherits:
PolymorphicDb show all
Defined in:
lib/kyotocabinet_ffi/db/file_hash_db.rb

Overview

deprecated - use PolymorphicDb directly

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PolymorphicDb

#[], #[]=, #clear, #empty?, tmp_filedb

Methods included from KyotoCabinet::Db

#clear, #clear!, #close, #close!, #get, #last_error, #last_error_code, #last_error_message, #new, #open, #open!, #set, #set!, #size

Constructor Details

#initialize(file_path, *options) ⇒ FileHash

Returns a new instance of FileHash.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kyotocabinet_ffi/db/file_hash_db.rb', line 8

def initialize(file_path, *options)
  fail ArgumentError.new('file_path must be set') unless file_path

  if not file_path.end_with? KyotoCabinet::FILE_HASH.to_s
    file_path << KyotoCabinet::FILE_HASH.to_s
  end

  @file_path = file_path

  self.new
  self.open!(@file_path, *options)
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



6
7
8
# File 'lib/kyotocabinet_ffi/db/file_hash_db.rb', line 6

def file_path
  @file_path
end