Module: Modesty::DatastoreMethods
- Included in:
- API
- Defined in:
- lib/modesty/datastore.rb
Instance Method Summary collapse
Instance Method Details
#data ⇒ Object
39 40 41 |
# File 'lib/modesty/datastore.rb', line 39 def data @data || set_store(:redis, :mock => true) end |
#handle_error(e) ⇒ Object
43 44 45 |
# File 'lib/modesty/datastore.rb', line 43 def handle_error(e) raise e end |
#set_store(type, opts = {}) ⇒ Object Also known as: data=
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/modesty/datastore.rb', line 27 def set_store(type, opts={}) @data = case type.to_s when 'redis' require File.join(Modesty::LIB, 'modesty', 'datastore', 'redis') RedisData.new(opts) else puts "Unrecognized datastore #{type}. Defaulting to MockRedis." self.set_store :redis, :mock => true end end |