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.



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

Returns:



324
325
326
# File 'lib/logstash/settings.rb', line 324

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