Class: GoldMine::IDB
Overview
Database with a related index file.
Instance Attribute Summary collapse
-
#index_reader ⇒ Object
readonly
Returns the value of attribute index_reader.
Attributes inherited from DB
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ IDB
constructor
A new instance of IDB.
- #random ⇒ Object
Methods inherited from DB
Constructor Details
#initialize(options = {}) ⇒ IDB
Returns a new instance of IDB.
8 9 10 11 12 13 |
# File 'lib/gold_mine/idb.rb', line 8 def initialize( = {}) super @index_reader = IndexReader.new("#{@path}.dat") @options = @index_reader. end |
Instance Attribute Details
#index_reader ⇒ Object (readonly)
Returns the value of attribute index_reader.
6 7 8 |
# File 'lib/gold_mine/idb.rb', line 6 def index_reader @index_reader end |
Instance Method Details
#random ⇒ Object
15 16 17 |
# File 'lib/gold_mine/idb.rb', line 15 def random find_fortune(@index_reader.random_pointer) end |