Class: LogStash::Setting::Validator

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

Instance Attribute Summary

Attributes inherited from LogStash::Setting

#default, #name

Instance Method Summary collapse

Methods inherited from LogStash::Setting

#==, #reset, #set, #set?, #strict?, #to_hash, #validate_value, #value

Constructor Details

#initialize(name, default = nil, strict = true, validator_class = nil) ⇒ Validator

Returns a new instance of Validator.



436
437
438
439
# File 'lib/logstash/settings.rb', line 436

def initialize(name, default=nil, strict=true, validator_class=nil)
  @validator_class = validator_class
  super(name, ::Object, default, strict)
end

Instance Method Details

#validate(value) ⇒ Object



441
442
443
# File 'lib/logstash/settings.rb', line 441

def validate(value)
  @validator_class.validate(value)
end