Class: HttpStub::Models::Response
- Inherits:
-
Object
- Object
- HttpStub::Models::Response
- Defined in:
- lib/http_stub/models/response.rb
Constant Summary collapse
- SUCCESS =
HttpStub::Models::Response.new("status" => 200, "body" => "OK")
- ERROR =
HttpStub::Models::Response.new("status" => 404, "body" => "ERROR")
- EMPTY =
HttpStub::Models::Response.new()
Instance Method Summary collapse
- #body ⇒ Object
- #delay_in_seconds ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(options = {}) ⇒ Response
constructor
A new instance of Response.
- #status ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Response
Returns a new instance of Response.
6 7 8 |
# File 'lib/http_stub/models/response.rb', line 6 def initialize( = {}) @response_options = || {} end |
Instance Method Details
#body ⇒ Object
18 19 20 |
# File 'lib/http_stub/models/response.rb', line 18 def body @response_options["body"] end |
#delay_in_seconds ⇒ Object
22 23 24 |
# File 'lib/http_stub/models/response.rb', line 22 def delay_in_seconds @response_options["delay_in_seconds"] end |
#empty? ⇒ Boolean
26 27 28 |
# File 'lib/http_stub/models/response.rb', line 26 def empty? @response_options.empty? end |
#status ⇒ Object
14 15 16 |
# File 'lib/http_stub/models/response.rb', line 14 def status @response_options["status"] end |