Class: Khronos::Storage
- Inherits:
-
Object
- Object
- Khronos::Storage
- Defined in:
- lib/khronos/storage.rb,
lib/khronos/storage/adapter.rb,
lib/khronos/storage/adapter/mongoid.rb,
lib/khronos/storage/adapter/activerecord.rb,
lib/khronos/storage/adapter/mongoid/schedule.rb,
lib/khronos/storage/adapter/mongoid/schedule_log.rb,
lib/khronos/storage/adapter/activerecord/schedule.rb,
lib/khronos/storage/adapter/activerecord/schedule_log.rb,
lib/khronos/storage/adapter/activerecord/migrations/schedule.rb,
lib/khronos/storage/adapter/activerecord/migrations/schedule_log.rb
Defined Under Namespace
Modules: Adapter
Instance Method Summary collapse
-
#initialize(uri = ENV['KHRONOS_STORAGE']) ⇒ Storage
constructor
A new instance of Storage.
- #logger=(logger) ⇒ Object
- #truncate! ⇒ Object
Constructor Details
#initialize(uri = ENV['KHRONOS_STORAGE']) ⇒ Storage
Returns a new instance of Storage.
7 8 9 10 11 12 |
# File 'lib/khronos/storage.rb', line 7 def initialize(uri=ENV['KHRONOS_STORAGE']) raise RuntimeError.new("Please configure 'KHRONOS_STORAGE' on your environment variables.") if uri.nil? @adapter = Adapter.get(uri) self.class.send(:include, @adapter) end |
Instance Method Details
#logger=(logger) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/khronos/storage.rb', line 14 def logger=(logger) # # Change logger current adapter's logger # raise NotImplementedMethod end |
#truncate! ⇒ Object
21 22 23 24 |
# File 'lib/khronos/storage.rb', line 21 def truncate! Schedule.delete_all ScheduleLog.delete_all end |