Class: ClickSign::Service::ErrorResponse
- Defined in:
- lib/click_sign/service.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Attributes inherited from Response
Instance Method Summary collapse
- #bad_request? ⇒ Boolean
- #error? ⇒ Boolean
- #forbiden? ⇒ Boolean
-
#initialize(**args) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #not_found? ⇒ Boolean
- #server_error? ⇒ Boolean
- #unauthorized? ⇒ Boolean
- #unprocessable_entity? ⇒ Boolean
Methods inherited from Response
Constructor Details
#initialize(**args) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
29 30 31 32 |
# File 'lib/click_sign/service.rb', line 29 def initialize(**args) super @errors = @body['errors'] if @body.present? end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
27 28 29 |
# File 'lib/click_sign/service.rb', line 27 def errors @errors end |
Instance Method Details
#bad_request? ⇒ Boolean
34 35 36 |
# File 'lib/click_sign/service.rb', line 34 def bad_request? @status_code == 400 end |
#error? ⇒ Boolean
58 59 60 |
# File 'lib/click_sign/service.rb', line 58 def error? true end |
#forbiden? ⇒ Boolean
42 43 44 |
# File 'lib/click_sign/service.rb', line 42 def forbiden? @status_code == 403 end |
#not_found? ⇒ Boolean
46 47 48 |
# File 'lib/click_sign/service.rb', line 46 def not_found? @status_code == 404 end |
#server_error? ⇒ Boolean
54 55 56 |
# File 'lib/click_sign/service.rb', line 54 def server_error? @status_code == 500 end |
#unauthorized? ⇒ Boolean
38 39 40 |
# File 'lib/click_sign/service.rb', line 38 def @status_code == 401 end |
#unprocessable_entity? ⇒ Boolean
50 51 52 |
# File 'lib/click_sign/service.rb', line 50 def unprocessable_entity? @status_code == 422 end |