Class: EventStore::HTTPClient::Client::Builder

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

Class Method Summary collapse

Class Method Details

.buildObject



9
10
11
12
13
# File 'lib/event_store_http_client/client/builder.rb', line 9

def self.build
  new.tap do |instance|
    Settings.instance.set instance, 'event_store_connection'
  end
end

.configure(receiver) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/event_store_http_client/client/builder.rb', line 15

def self.configure(receiver)
  instance = build
  logger = Logger.get self
  logger.trace "Configuring Client"

  client = Vertx::HttpClient.new.tap do |client|
    client.host = instance.host
    client.port = instance.port
  end

  receiver.client = client
  client
end