Exception: Fortnox::RequestError

Inherits:
Error
  • Object
show all
Defined in:
lib/fortnox.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg = nil) ⇒ RequestError

Returns a new instance of RequestError.



23
24
25
26
27
28
29
30
# File 'lib/fortnox.rb', line 23

def initialize(arg = nil)
  if arg.respond_to?(:status)
    @response = arg
    super("Request failed: #{arg.status}")
  else
    super
  end
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



21
22
23
# File 'lib/fortnox.rb', line 21

def response
  @response
end