Exception: Grac::Exception::ClientException
- Inherits:
-
StandardError
- Object
- StandardError
- Grac::Exception::ClientException
- Defined in:
- lib/grac/exception.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(method, url, body) ⇒ ClientException
constructor
A new instance of ClientException.
- #inspect ⇒ Object
- #message ⇒ Object (also: #to_s)
Constructor Details
#initialize(method, url, body) ⇒ ClientException
Returns a new instance of ClientException.
8 9 10 11 12 |
# File 'lib/grac/exception.rb', line 8 def initialize(method, url, body) @method = (method || "").upcase @url = url @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/grac/exception.rb', line 6 def body @body end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/grac/exception.rb', line 6 def method @method end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/grac/exception.rb', line 6 def url @url end |
Instance Method Details
#inspect ⇒ Object
14 15 16 |
# File 'lib/grac/exception.rb', line 14 def inspect "#{self.class.name}: #{}" end |
#message ⇒ Object Also known as: to_s
18 19 20 |
# File 'lib/grac/exception.rb', line 18 def "#{@method} '#{@url}' failed with content: #{@body}" end |