Class: LogStashLogger::Device::Socket
- Inherits:
-
Connectable
- Object
- Base
- Connectable
- LogStashLogger::Device::Socket
- Defined in:
- lib/logstash-logger/device/socket.rb
Constant Summary collapse
- DEFAULT_HOST =
'0.0.0.0'
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(opts) ⇒ Socket
constructor
A new instance of Socket.
Methods inherited from Connectable
#connected?, #flush, #to_io, #write
Methods inherited from Base
#close, #flush, #to_io, #write
Constructor Details
#initialize(opts) ⇒ Socket
Returns a new instance of Socket.
10 11 12 13 14 |
# File 'lib/logstash-logger/device/socket.rb', line 10 def initialize(opts) super @port = opts[:port] || fail(ArgumentError, "Port is required") @host = opts[:host] || DEFAULT_HOST end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/logstash-logger/device/socket.rb', line 8 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
8 9 10 |
# File 'lib/logstash-logger/device/socket.rb', line 8 def port @port end |