Exception: Shippinglogic::Error

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

Direct Known Subclasses

FedEx::Error, UPS::Error

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Error) initialize(request, response)



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

def initialize(request, response)
  self.request = request
  self.response = response
end

Instance Attribute Details

- (Object) errors

Returns the value of attribute errors



3
4
5
# File 'lib/shippinglogic/error.rb', line 3

def errors
  @errors ||= []
end

- (Object) request

Returns the value of attribute request



3
4
5
# File 'lib/shippinglogic/error.rb', line 3

def request
  @request
end

- (Object) response

Returns the value of attribute response



3
4
5
# File 'lib/shippinglogic/error.rb', line 3

def response
  @response
end

Instance Method Details

- (Object) add_error(error, code = nil)



10
11
12
# File 'lib/shippinglogic/error.rb', line 10

def add_error(error, code = nil)
  errors << {:message => error, :code => code}
end

- (Object) message



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

def message
  errors.collect { |e| e[:message] }.join(", ")
end