Class: BomDB::Import::Result
- Inherits:
-
Object
- Object
- BomDB::Import::Result
- Defined in:
- lib/bomdb/import/result.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
Instance Method Summary collapse
-
#initialize(success:, error: nil) ⇒ Result
constructor
A new instance of Result.
- #message ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(success:, error: nil) ⇒ Result
Returns a new instance of Result.
6 7 8 9 |
# File 'lib/bomdb/import/result.rb', line 6 def initialize(success:, error: nil) @success = success @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
4 5 6 |
# File 'lib/bomdb/import/result.rb', line 4 def error @error end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
4 5 6 |
# File 'lib/bomdb/import/result.rb', line 4 def success @success end |
Instance Method Details
#message ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/bomdb/import/result.rb', line 15 def if @success "Succeeded" else @error.to_s end end |
#success? ⇒ Boolean
11 12 13 |
# File 'lib/bomdb/import/result.rb', line 11 def success? @success end |