Class: ActiveMerchant::Shipping::Response
- Defined in:
- lib/active_shipping/shipping/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(success, message, params = {}, options = {}) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
- #test? ⇒ Boolean
Constructor Details
#initialize(success, message, params = {}, options = {}) ⇒ Response
Returns a new instance of Response.
29 30 31 32 33 34 35 |
# File 'lib/active_shipping/shipping/response.rb', line 29 def initialize(success, , params = {}, = {}) @success, @message, @params = success, , params.stringify_keys @test = [:test] || false @xml = [:xml] @request = [:request] raise ResponseError.new(self) unless success end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
24 25 26 |
# File 'lib/active_shipping/shipping/response.rb', line 24 def @message end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
23 24 25 |
# File 'lib/active_shipping/shipping/response.rb', line 23 def params @params end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
27 28 29 |
# File 'lib/active_shipping/shipping/response.rb', line 27 def request @request end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
25 26 27 |
# File 'lib/active_shipping/shipping/response.rb', line 25 def test @test end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
26 27 28 |
# File 'lib/active_shipping/shipping/response.rb', line 26 def xml @xml end |
Instance Method Details
#success? ⇒ Boolean
37 38 39 |
# File 'lib/active_shipping/shipping/response.rb', line 37 def success? @success ? true : false end |
#test? ⇒ Boolean
41 42 43 |
# File 'lib/active_shipping/shipping/response.rb', line 41 def test? @test ? true : false end |