Class: Tidas::ErrorResult
- Inherits:
-
Object
- Object
- Tidas::ErrorResult
- Defined in:
- lib/tidas/error_result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#tidas_id ⇒ Object
readonly
Returns the value of attribute tidas_id.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ErrorResult
constructor
:nodoc:.
- #msg ⇒ Object
- #success? ⇒ Boolean
- #to_json ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ ErrorResult
:nodoc:
7 8 9 10 |
# File 'lib/tidas/error_result.rb', line 7 def initialize(attributes = {}) # :nodoc: @tidas_id = attributes[:tidas_id] @errors = Array(attributes[:errors]) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/tidas/error_result.rb', line 5 def errors @errors end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/tidas/error_result.rb', line 5 def end |
#tidas_id ⇒ Object (readonly)
Returns the value of attribute tidas_id.
5 6 7 |
# File 'lib/tidas/error_result.rb', line 5 def tidas_id @tidas_id end |
Instance Method Details
#msg ⇒ Object
16 17 18 |
# File 'lib/tidas/error_result.rb', line 16 def msg @errors.first end |
#success? ⇒ Boolean
12 13 14 |
# File 'lib/tidas/error_result.rb', line 12 def success? false end |
#to_json ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/tidas/error_result.rb', line 20 def to_json { error_result: { tidas_id: @tidas_id, errors: @errors.map(&:to_s) } }.to_json end |