Class: SimpleMapReduce::DataStoreFactory
- Inherits:
-
Object
- Object
- SimpleMapReduce::DataStoreFactory
- Defined in:
- lib/simple_map_reduce/data_store_factory.rb
Constant Summary collapse
- TYPES =
%w(default remote).freeze
Class Method Summary collapse
Class Method Details
.create(data_store_type, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/simple_map_reduce/data_store_factory.rb', line 8 def create(data_store_type, = {}) unless TYPES.include?(data_store_type) raise ArgumentError, "Unsupported data_store_type: `#{data_store_type}`" end case data_store_type when 'default' SimpleMapReduce::DataStores::DefaultDataStore.new() when 'remote' SimpleMapReduce::DataStores::RemoteDataStore.new() end end |