Class: NewsCrawler::Storage::YAMLStor::YAMLStorEngine
- Inherits:
-
Object
- Object
- NewsCrawler::Storage::YAMLStor::YAMLStorEngine
- Defined in:
- lib/news_crawler/storage/yaml_stor/yaml_stor_engine.rb
Overview
Basic class for YAMLStor engine. Subclass and implement all its method to create new YAMLStor engine, you should keep methods’ singature unchanged
Direct Known Subclasses
Class Method Summary collapse
-
.get_engines ⇒ Array
Get engine list.
- .inherited(klass) ⇒ Object
Instance Method Summary collapse
-
#add(module_name, key, value) ⇒ Object
Add entry to raw data collection.
- #clear ⇒ Object
- #count ⇒ Object
-
#get(module_name, key) ⇒ Object?
Get entry to raw data collection.
Class Method Details
.get_engines ⇒ Array
Get engine list
36 37 38 39 40 41 42 |
# File 'lib/news_crawler/storage/yaml_stor/yaml_stor_engine.rb', line 36 def self.get_engines @engine_list = @engine_list || [] @engine_list.inject({}) do | memo, klass | memo[klass::NAME.intern] = klass memo end end |
.inherited(klass) ⇒ Object
30 31 32 |
# File 'lib/news_crawler/storage/yaml_stor/yaml_stor_engine.rb', line 30 def self.inherited(klass) @engine_list = (@engine_list || []) + [klass] end |
Instance Method Details
#add(module_name, key, value) ⇒ Object
Add entry to raw data collection
48 49 50 |
# File 'lib/news_crawler/storage/yaml_stor/yaml_stor_engine.rb', line 48 def add(module_name, key, value) raise NotImplementedError end |
#clear ⇒ Object
64 65 66 |
# File 'lib/news_crawler/storage/yaml_stor/yaml_stor_engine.rb', line 64 def clear raise NotImplementedError end |
#count ⇒ Object
60 61 62 |
# File 'lib/news_crawler/storage/yaml_stor/yaml_stor_engine.rb', line 60 def count raise NotImplementedError end |
#get(module_name, key) ⇒ Object?
Get entry to raw data collection
56 57 58 |
# File 'lib/news_crawler/storage/yaml_stor/yaml_stor_engine.rb', line 56 def get(module_name, key) raise NotImplementedError end |