Exception: Shippinglogic::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Shippinglogic::Error
- Defined in:
- lib/shippinglogic/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #add_error(error, code = nil) ⇒ Object
-
#initialize(request, response) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(request, response) ⇒ Error
Returns a new instance of Error.
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
#errors ⇒ Object
Returns the value of attribute errors.
3 4 5 |
# File 'lib/shippinglogic/error.rb', line 3 def errors @errors end |
#request ⇒ Object
Returns the value of attribute request.
3 4 5 |
# File 'lib/shippinglogic/error.rb', line 3 def request @request end |
#response ⇒ Object
Returns the value of attribute response.
3 4 5 |
# File 'lib/shippinglogic/error.rb', line 3 def response @response end |
Instance Method Details
#add_error(error, code = nil) ⇒ Object
10 11 12 |
# File 'lib/shippinglogic/error.rb', line 10 def add_error(error, code = nil) errors << {:message => error, :code => code} end |
#message ⇒ Object
18 19 20 |
# File 'lib/shippinglogic/error.rb', line 18 def errors.collect { |e| e[:message] }.join(", ") end |