Class: LucidIntercom::Response
- Inherits:
-
Object
- Object
- LucidIntercom::Response
- Extended by:
- Dry::Initializer
- Defined in:
- lib/lucid_intercom/response.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
Instance Method Summary collapse
- #assert! ⇒ self
- #data ⇒ String
-
#data_hash ⇒ Hash
The parsed response body.
- #headers ⇒ Hash
- #status_code ⇒ Integer
Instance Method Details
#assert! ⇒ self
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/lucid_intercom/response.rb', line 62 def assert! case status_code when 400..499 raise ClientError.new(self) when 500..599 raise ServerError.new(self) end self end |
#data ⇒ String
36 |
# File 'lib/lucid_intercom/response.rb', line 36 param :data |
#data_hash ⇒ Hash
Returns the parsed response body.
38 |
# File 'lib/lucid_intercom/response.rb', line 38 param :data_hash, default: -> { parse_data } |
#headers ⇒ Hash
34 |
# File 'lib/lucid_intercom/response.rb', line 34 param :headers |
#status_code ⇒ Integer
32 |
# File 'lib/lucid_intercom/response.rb', line 32 param :status_code |