Class: LearnOpen::FileBackupStarter
- Inherits:
-
Object
- Object
- LearnOpen::FileBackupStarter
- Defined in:
- lib/learn_open/services/file_backup_starter.rb
Instance Attribute Summary collapse
-
#lesson ⇒ Object
readonly
Returns the value of attribute lesson.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#system_adapter ⇒ Object
readonly
Returns the value of attribute system_adapter.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(lesson, location, options) ⇒ FileBackupStarter
constructor
A new instance of FileBackupStarter.
Constructor Details
#initialize(lesson, location, options) ⇒ FileBackupStarter
Returns a new instance of FileBackupStarter.
9 10 11 12 13 |
# File 'lib/learn_open/services/file_backup_starter.rb', line 9 def initialize(lesson, location, ) @lesson = lesson @location = location @system_adapter = .fetch(:system_adapter, LearnOpen.system_adapter) end |
Instance Attribute Details
#lesson ⇒ Object (readonly)
Returns the value of attribute lesson.
3 4 5 |
# File 'lib/learn_open/services/file_backup_starter.rb', line 3 def lesson @lesson end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/learn_open/services/file_backup_starter.rb', line 3 def location @location end |
#system_adapter ⇒ Object (readonly)
Returns the value of attribute system_adapter.
3 4 5 |
# File 'lib/learn_open/services/file_backup_starter.rb', line 3 def system_adapter @system_adapter end |
Class Method Details
.call(lesson, location, options) ⇒ Object
5 6 7 |
# File 'lib/learn_open/services/file_backup_starter.rb', line 5 def self.call(lesson, location, ) self.new(lesson, location, ).call end |
Instance Method Details
#call ⇒ Object
15 16 17 18 |
# File 'lib/learn_open/services/file_backup_starter.rb', line 15 def call system_adapter.spawn("restore-lab", block: true) system_adapter.watch_dir("#{lesson.to_path}", "backup-lab") end |