Exception: Entrata::Request::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/entrata/request/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, code = nil) ⇒ Error

Returns a new instance of Error.



4
5
6
7
8
# File 'lib/entrata/request/error.rb', line 4

def initialize(msg = nil, code = nil)
  super(msg)
  @code = code
  @msg = msg
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



18
19
20
# File 'lib/entrata/request/error.rb', line 18

def code
  @code
end

#msgObject (readonly)

Returns the value of attribute msg.



18
19
20
# File 'lib/entrata/request/error.rb', line 18

def msg
  @msg
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
16
# File 'lib/entrata/request/error.rb', line 10

def to_s
  if code
    "message: #{msg}, code: #{code}"
  else
    msg
  end
end