Class: TurnoutProxy::HostChooser

Inherits:
Object
  • Object
show all
Defined in:
lib/turnout_proxy/host_chooser.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, options = {}) ⇒ HostChooser

Returns a new instance of HostChooser.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/turnout_proxy/host_chooser.rb', line 4

def initialize(connection, options = {})
  @connection = connection
  @file_checker = options.fetch(:file_checker) { File }

  @default = validate_host(options[:default])
  @alternate = validate_host(options[:alternate])

  @lock_file = options[:lock_file]

  choose_destination_server!
end

Instance Method Details

#on_data(data) ⇒ Object



16
17
18
# File 'lib/turnout_proxy/host_chooser.rb', line 16

def on_data(data)
  data
end