Class: KyotoCabinet::Db::FileHash
- Inherits:
-
PolymorphicDb
- Object
- PolymorphicDb
- KyotoCabinet::Db::FileHash
- Defined in:
- lib/kyotocabinet_ffi/db/file_hash_db.rb
Overview
deprecated - use PolymorphicDb directly
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
-
#initialize(file_path, *options) ⇒ FileHash
constructor
A new instance of FileHash.
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, *) 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, *) end |
Instance Attribute Details
#file_path ⇒ Object (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 |