Class: ExchangeRateJt::DataStoreFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/exchange_rate_jt/data_store_factory.rb

Overview

DataStoreFactory builds and returns an instance of the appropriate data store handler for the defined data store type

Constant Summary collapse

MAPS =
{ pstore: DataStore::PStoreAdaptor }.freeze

Class Method Summary collapse

Class Method Details

.build(data_store_type, data_store) ⇒ Object



11
12
13
14
15
16
# File 'lib/exchange_rate_jt/data_store_factory.rb', line 11

def self.build(data_store_type, data_store)
  MAPS[data_store_type].new(data_store)
rescue
  raise InvalidDataStoreTypeError, 
        'Invalid or no data store type specified'
end