Exception: K8::HttpException
- Inherits:
-
Exception
- Object
- Exception
- K8::HttpException
- Defined in:
- lib/keight.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#response_headers ⇒ Object
readonly
Returns the value of attribute response_headers.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code, message = nil, response_headers = nil) ⇒ HttpException
constructor
A new instance of HttpException.
- #status_message ⇒ Object
Constructor Details
#initialize(status_code, message = nil, response_headers = nil) ⇒ HttpException
Returns a new instance of HttpException.
635 636 637 638 639 640 |
# File 'lib/keight.rb', line 635 def initialize(status_code, =nil, response_headers=nil) response_headers, = , nil if .is_a?(Hash) @status_code = status_code @message = if @response_headers = response_headers if response_headers end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
642 643 644 |
# File 'lib/keight.rb', line 642 def @message end |
#response_headers ⇒ Object (readonly)
Returns the value of attribute response_headers.
642 643 644 |
# File 'lib/keight.rb', line 642 def response_headers @response_headers end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
642 643 644 |
# File 'lib/keight.rb', line 642 def status_code @status_code end |
Instance Method Details
#status_message ⇒ Object
644 645 646 |
# File 'lib/keight.rb', line 644 def return HTTP_RESPONSE_STATUS[@status_code] end |