Class: Omniship::Response
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.
26 27 28 29 30 31 32 |
# File 'lib/omniship/response.rb', line 26 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.
21 22 23 |
# File 'lib/omniship/response.rb', line 21 def @message end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
20 21 22 |
# File 'lib/omniship/response.rb', line 20 def params @params end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
24 25 26 |
# File 'lib/omniship/response.rb', line 24 def request @request end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
22 23 24 |
# File 'lib/omniship/response.rb', line 22 def test @test end |
#xml ⇒ Object (readonly)
Returns the value of attribute xml.
23 24 25 |
# File 'lib/omniship/response.rb', line 23 def xml @xml end |
Instance Method Details
#success? ⇒ Boolean
34 35 36 |
# File 'lib/omniship/response.rb', line 34 def success? @success ? true : false end |
#test? ⇒ Boolean
38 39 40 |
# File 'lib/omniship/response.rb', line 38 def test? @test ? true : false end |