Class: LogStash::Setting::Port
- Inherits:
-
Integer
- Object
- LogStash::Setting
- Coercible
- Integer
- LogStash::Setting::Port
- Defined in:
- lib/logstash/settings.rb
Constant Summary collapse
- VALID_PORT_RANGE =
1..65535
Instance Attribute Summary
Attributes inherited from LogStash::Setting
Instance Method Summary collapse
-
#initialize(name, default = nil, strict = true) ⇒ Port
constructor
A new instance of Port.
- #valid?(port) ⇒ Boolean
Methods inherited from Integer
Methods inherited from Coercible
Methods inherited from LogStash::Setting
#==, #reset, #set, #set?, #strict?, #to_hash, #validate_value, #value
Methods included from Util::Loggable
included, #logger, #slow_logger
Constructor Details
#initialize(name, default = nil, strict = true) ⇒ Port
Returns a new instance of Port.
320 321 322 |
# File 'lib/logstash/settings.rb', line 320 def initialize(name, default=nil, strict=true) super(name, default, strict) { |value| valid?(value) } end |
Instance Method Details
#valid?(port) ⇒ Boolean
324 325 326 |
# File 'lib/logstash/settings.rb', line 324 def valid?(port) VALID_PORT_RANGE.cover?(port) end |