Class: SimpleResponse::Response
- Inherits:
-
SimpleStruct
- Object
- SimpleStruct
- SimpleResponse::Response
- Defined in:
- lib/simple_response/response.rb
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(success:, **attributes) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Methods inherited from SimpleStruct
Methods included from QueryMethods
Constructor Details
#initialize(success:, **attributes) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/simple_response/response.rb', line 6 def initialize(success:, **attributes) super(attributes) @success = success end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SimpleResponse::SimpleStruct
Instance Method Details
#failure? ⇒ Boolean
15 16 17 |
# File 'lib/simple_response/response.rb', line 15 def failure? !success? end |
#success? ⇒ Boolean
11 12 13 |
# File 'lib/simple_response/response.rb', line 11 def success? @success end |