Class: MarkovUuid::Storage
- Inherits:
-
Object
- Object
- MarkovUuid::Storage
- Defined in:
- lib/markov_uuid/storage.rb
Instance Attribute Summary collapse
-
#cache_file ⇒ Object
Returns the value of attribute cache_file.
-
#data ⇒ Object
writeonly
Sets the attribute data.
-
#input_file ⇒ Object
Returns the value of attribute input_file.
Instance Method Summary collapse
- #chain ⇒ Object
-
#file_klass ⇒ Object
for testing.
-
#initialize(input_file, cache_file) ⇒ Storage
constructor
A new instance of Storage.
-
#uuid ⇒ Object
note these are not by any means guaranteed to be unique dependent on uuid length and corpus size maybe maintain uniqueness elsewhere by regenerating unless unique.
Constructor Details
#initialize(input_file, cache_file) ⇒ Storage
Returns a new instance of Storage.
18 19 20 21 22 |
# File 'lib/markov_uuid/storage.rb', line 18 def initialize input_file, cache_file @input_file, @cache_file = input_file, cache_file preload_data end |
Instance Attribute Details
#cache_file ⇒ Object
Returns the value of attribute cache_file.
5 6 7 |
# File 'lib/markov_uuid/storage.rb', line 5 def cache_file @cache_file end |
#data=(value) ⇒ Object
Sets the attribute data
5 6 7 |
# File 'lib/markov_uuid/storage.rb', line 5 def data=(value) @data = value end |
#input_file ⇒ Object
Returns the value of attribute input_file.
5 6 7 |
# File 'lib/markov_uuid/storage.rb', line 5 def input_file @input_file end |
Instance Method Details
#chain ⇒ Object
14 15 16 |
# File 'lib/markov_uuid/storage.rb', line 14 def chain @chain ||= MarkovUuid::Chain.new data end |
#file_klass ⇒ Object
for testing
25 26 27 |
# File 'lib/markov_uuid/storage.rb', line 25 def file_klass File end |
#uuid ⇒ Object
note these are not by any means guaranteed to be unique dependent on uuid length and corpus size maybe maintain uniqueness elsewhere by regenerating unless unique
10 11 12 |
# File 'lib/markov_uuid/storage.rb', line 10 def uuid chain.uuid end |