Class: LucidIntercom::Response

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/lucid_intercom/response.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

ClientError =
Class.new(Error)
ServerError =
Class.new(Error)

Instance Method Summary collapse

Instance Method Details

#assert!Boolean

Returns:

  • (Boolean)

Raises:



38
39
40
41
42
43
44
45
46
47
# File 'lib/lucid_intercom/response.rb', line 38

def assert!
  case status_code
  when 400..499
    raise ClientError.new(status_code)
  when 500..599
    raise ServerError.new(status_code)
  end

  true
end

#status_codeInteger

Returns:

  • (Integer)


30
# File 'lib/lucid_intercom/response.rb', line 30

param :status_code