Class: Consul::Client::FakeNetHttpResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/consul/client/fake_http_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body = "Good news everyone!") ⇒ FakeNetHttpResponse

Returns a new instance of FakeNetHttpResponse.



7
8
9
# File 'lib/consul/client/fake_http_response.rb', line 7

def initialize(body="Good news everyone!")
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/consul/client/fake_http_response.rb', line 6

def body
  @body
end

Instance Method Details

#codeObject



11
12
13
# File 'lib/consul/client/fake_http_response.rb', line 11

def code
  "200"
end

#code_typeObject



15
16
17
# File 'lib/consul/client/fake_http_response.rb', line 15

def code_type
  Net::HTTPOK
end