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
- #headers ⇒ Object
-
#initialize(options = {}) ⇒ Response
constructor
A new instance of Response.
- #status ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Response
Returns a new instance of Response.
16 17 18 19 20 |
# File 'lib/http_stub/models/response.rb', line 16 def initialize( = {}) = = .clone establish_defaults_in() end |
Instance Method Details
#body ⇒ Object
30 31 32 |
# File 'lib/http_stub/models/response.rb', line 30 def body ["body"] end |
#delay_in_seconds ⇒ Object
34 35 36 |
# File 'lib/http_stub/models/response.rb', line 34 def delay_in_seconds ["delay_in_seconds"] end |
#empty? ⇒ Boolean
42 43 44 |
# File 'lib/http_stub/models/response.rb', line 42 def empty? .empty? end |
#headers ⇒ Object
38 39 40 |
# File 'lib/http_stub/models/response.rb', line 38 def headers {"content-type" => ["content_type"]} end |
#status ⇒ Object
26 27 28 |
# File 'lib/http_stub/models/response.rb', line 26 def status ["status"] end |