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

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

Returns:



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

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