Class: HttpStub::Client::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(server_uri) ⇒ Client

Returns a new instance of Client.


12
13
14
15
# File 'lib/http_stub/client/client.rb', line 12

def initialize(server_uri)
  @server          = HttpStub::Client::Server.new(server_uri)
  @default_session = HttpStub::Client::Session.new(TRANSACTIONAL_SESSION_ID, @server)
end

Instance Method Details

#reset!Object


21
22
23
# File 'lib/http_stub/client/client.rb', line 21

def reset!
  @server.submit!(method: :delete, path: "sessions", intent: "reset server")
end

#session(id) ⇒ Object


17
18
19
# File 'lib/http_stub/client/client.rb', line 17

def session(id)
  HttpStub::Client::Session.new(id, @server)
end