Class: FFWD::UDP::SetupOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/ffwd/protocol/udp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, log, handler) ⇒ SetupOutput

Returns a new instance of SetupOutput.



30
31
32
33
34
35
# File 'lib/ffwd/protocol/udp.rb', line 30

def initialize config, log, handler
  @config = config
  @log = log
  @handler = handler
  @config = Connect.prepare Hash[@config]
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



28
29
30
# File 'lib/ffwd/protocol/udp.rb', line 28

def config
  @config
end

Instance Method Details

#connect(core) ⇒ Object



37
38
39
40
41
# File 'lib/ffwd/protocol/udp.rb', line 37

def connect core
  raise "Missing required key :host" if (host = @config[:host]).nil?
  raise "Missing required key :port" if (port = @config[:port]).nil?
  Connect.new core, @log, host, port, @handler, @config
end