Class: HttpStub::Models::Response

Inherits:
Object
  • Object
show all
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

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(options = {})
  @response_options = 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

Returns:

  • (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