Class: LogStash::Setting::Port

Inherits:
Integer show all
Defined in:
lib/logstash/settings.rb

Constant Summary collapse

VALID_PORT_RANGE =
1..65535

Instance Attribute Summary

Attributes inherited from LogStash::Setting

#default, #name

Instance Method Summary collapse

Methods inherited from Integer

#coerce

Methods inherited from Coercible

#coerce, #set

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.



348
349
350
# File 'lib/logstash/settings.rb', line 348

def initialize(name, default=nil, strict=true)
  super(name, default, strict) { |value| valid?(value) }
end

Instance Method Details

#valid?(port) ⇒ Boolean

Returns:



352
353
354
# File 'lib/logstash/settings.rb', line 352

def valid?(port)
  VALID_PORT_RANGE.cover?(port)
end