Class: NoopBackup::Commands::CommandResult
- Inherits:
-
Struct
- Object
- Struct
- NoopBackup::Commands::CommandResult
- Defined in:
- lib/noop_backup/commands/backup.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#store_results ⇒ Object
Returns the value of attribute store_results.
Instance Method Summary collapse
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error
4 5 6 |
# File 'lib/noop_backup/commands/backup.rb', line 4 def error @error end |
#store_results ⇒ Object
Returns the value of attribute store_results
4 5 6 |
# File 'lib/noop_backup/commands/backup.rb', line 4 def store_results @store_results end |
Instance Method Details
#report ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/noop_backup/commands/backup.rb', line 17 def report if error NoopBackup.notify "❌ Fatal error: #{error.}" else store_results.each do |result| NoopBackup.notify result. end end end |
#status ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/noop_backup/commands/backup.rb', line 9 def status return :error if error return :error if store_results.empty? || store_results.none?(&:success) return :success if store_results.all?(&:success) :partial_success end |
#success? ⇒ Boolean
5 6 7 |
# File 'lib/noop_backup/commands/backup.rb', line 5 def success? status == :success end |