Class: FFWD::UDP::SetupOutput
- Inherits:
-
Object
- Object
- FFWD::UDP::SetupOutput
- Defined in:
- lib/ffwd/protocol/udp.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #connect(core) ⇒ Object
-
#initialize(config, log, handler) ⇒ SetupOutput
constructor
A new instance of SetupOutput.
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
#config ⇒ Object (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 |