Class: ActiveFulfillment::Response
- Inherits:
-
Object
- Object
- ActiveFulfillment::Response
- Defined in:
- lib/active_fulfillment/response.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
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.
15 16 17 18 |
# File 'lib/active_fulfillment/response.rb', line 15 def initialize(success, , params = {}, = {}) @success, @message, @params = success, , params.stringify_keys @test = [:test] || false end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object (private)
21 22 23 |
# File 'lib/active_fulfillment/response.rb', line 21 def method_missing(method, *args) @params[method.to_s] || super end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/active_fulfillment/response.rb', line 4 def @message end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/active_fulfillment/response.rb', line 3 def params @params end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
5 6 7 |
# File 'lib/active_fulfillment/response.rb', line 5 def test @test end |
Instance Method Details
#success? ⇒ Boolean
7 8 9 |
# File 'lib/active_fulfillment/response.rb', line 7 def success? @success end |
#test? ⇒ Boolean
11 12 13 |
# File 'lib/active_fulfillment/response.rb', line 11 def test? @test end |