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
Constructor Details
#initialize(name, default = nil, strict = true) ⇒ Port
Returns a new instance of Port.
347 348 349 |
# File 'lib/logstash/settings.rb', line 347 def initialize(name, default=nil, strict=true) super(name, default, strict) { |value| valid?(value) } end |
Instance Method Details
#valid?(port) ⇒ Boolean
351 352 353 |
# File 'lib/logstash/settings.rb', line 351 def valid?(port) VALID_PORT_RANGE.cover?(port) end |