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

Raises:



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

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



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

param :status_code