Class: LogStash::Setting::ArrayCoercible

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

Direct Known Subclasses

SplittableStringArray

Instance Attribute Summary

Attributes inherited from LogStash::Setting

#default, #name

Instance Method Summary collapse

Methods inherited from Coercible

#set

Methods inherited from LogStash::Setting

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

Constructor Details

#initialize(name, klass, default, strict = true, &validator_proc) ⇒ ArrayCoercible

Returns a new instance of ArrayCoercible.



563
564
565
566
# File 'lib/logstash/settings.rb', line 563

def initialize(name, klass, default, strict=true, &validator_proc)
  @element_class = klass
  super(name, ::Array, default, strict, &validator_proc)
end

Instance Method Details

#coerce(value) ⇒ Object



568
569
570
# File 'lib/logstash/settings.rb', line 568

def coerce(value)
  Array(value)
end