Class: Mercurius::FakeResponse
- Inherits:
-
Object
- Object
- Mercurius::FakeResponse
- Defined in:
- lib/mercurius/testing/fake_response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ FakeResponse
constructor
A new instance of FakeResponse.
- #success? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ FakeResponse
Returns a new instance of FakeResponse.
5 6 7 8 |
# File 'lib/mercurius/testing/fake_response.rb', line 5 def initialize( = {}) @body = [:body] @status = [:status] end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/mercurius/testing/fake_response.rb', line 3 def body @body end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/mercurius/testing/fake_response.rb', line 3 def status @status end |
Instance Method Details
#success? ⇒ Boolean
10 11 12 |
# File 'lib/mercurius/testing/fake_response.rb', line 10 def success? (200..399).include? @status end |