Class: EasyBackup::Base
- Inherits:
-
Object
- Object
- EasyBackup::Base
- Defined in:
- lib/easy_backup/base.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(interval = EasyBackup.interval, &block) ⇒ Base
constructor
A new instance of Base.
- #start ⇒ Object
Constructor Details
#initialize(interval = EasyBackup.interval, &block) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 |
# File 'lib/easy_backup/base.rb', line 7 def initialize(interval=EasyBackup.interval, &block) @configurations = {} instance_eval &block @scheduler = Rufus::Scheduler.start_new frequency: interval schedule end |
Instance Method Details
#[](name) ⇒ Object
14 15 16 |
# File 'lib/easy_backup/base.rb', line 14 def [](name) @configurations[name] end |
#start ⇒ Object
18 19 20 |
# File 'lib/easy_backup/base.rb', line 18 def start @scheduler.join end |