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