Exception: Passage::PassageError
- Inherits:
-
StandardError
- Object
- StandardError
- Passage::PassageError
- Defined in:
- lib/passageidentity/error.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#status_text ⇒ Object
readonly
Returns the value of attribute status_text.
Instance Method Summary collapse
-
#initialize(message:, status_code: nil, body: nil) ⇒ PassageError
constructor
A new instance of PassageError.
Constructor Details
#initialize(message:, status_code: nil, body: nil) ⇒ PassageError
Returns a new instance of PassageError.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/passageidentity/error.rb', line 10 def initialize(message:, status_code: nil, body: nil) @message = @status_code = status_code @status_text = ( if status_code.nil? nil else Net::HTTPResponse::CODE_TO_OBJ[status_code.to_s] end ) @error = body.nil? ? nil : body["error"] end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
8 9 10 |
# File 'lib/passageidentity/error.rb', line 8 def error @error end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/passageidentity/error.rb', line 7 def @message end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
5 6 7 |
# File 'lib/passageidentity/error.rb', line 5 def status_code @status_code end |
#status_text ⇒ Object (readonly)
Returns the value of attribute status_text.
6 7 8 |
# File 'lib/passageidentity/error.rb', line 6 def status_text @status_text end |