Exception: NinjaVan::RequestError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RequestError

Returns a new instance of RequestError.



13
14
15
16
# File 'lib/ninja_van/error.rb', line 13

def initialize(response)
  super
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/ninja_van/error.rb', line 5

def response
  @response
end

Instance Method Details

#errorObject



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

def error
  @error ||= OpenStruct.new(response['error'])
end