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.



26
27
28
29
30
31
32
33
# File 'lib/fortnox.rb', line 26

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

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



24
25
26
# File 'lib/fortnox.rb', line 24

def response
  @response
end