Class: SynchronisedMigration::Result
- Inherits:
-
Object
- Object
- SynchronisedMigration::Result
- Defined in:
- lib/synchronised_migration/result.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(error = nil) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(error = nil) ⇒ Result
Returns a new instance of Result.
6 7 8 |
# File 'lib/synchronised_migration/result.rb', line 6 def initialize(error = nil) @error = error end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
4 5 6 |
# File 'lib/synchronised_migration/result.rb', line 4 def error @error end |
Class Method Details
.fail(error) ⇒ Object
18 19 20 |
# File 'lib/synchronised_migration/result.rb', line 18 def self.fail(error) self.new error end |
.ok ⇒ Object
14 15 16 |
# File 'lib/synchronised_migration/result.rb', line 14 def self.ok self.new end |
Instance Method Details
#success? ⇒ Boolean
10 11 12 |
# File 'lib/synchronised_migration/result.rb', line 10 def success? error.nil? end |