Exception: PhraseApp::RequestErrors::ValidationErrorResponse
- Inherits:
-
StandardError
- Object
- StandardError
- PhraseApp::RequestErrors::ValidationErrorResponse
- Defined in:
- lib/phraseapp-ruby/request_handler.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(http_response) ⇒ ValidationErrorResponse
constructor
A new instance of ValidationErrorResponse.
Constructor Details
#initialize(http_response) ⇒ ValidationErrorResponse
Returns a new instance of ValidationErrorResponse.
23 24 25 26 27 |
# File 'lib/phraseapp-ruby/request_handler.rb', line 23 def initialize(http_response) hash = JSON.load(http_response.body) @message = hash['message'] @errors = hash['errors'].map { |error| ValidationErrorMessage.new(error) } end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
21 22 23 |
# File 'lib/phraseapp-ruby/request_handler.rb', line 21 def errors @errors end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
20 21 22 |
# File 'lib/phraseapp-ruby/request_handler.rb', line 20 def @message end |