Class: LogStash::Setting::Modules
- Inherits:
-
Coercible
- Object
- LogStash::Setting
- Coercible
- LogStash::Setting::Modules
- Defined in:
- lib/logstash/settings.rb
Instance Attribute Summary
Attributes inherited from LogStash::Setting
Instance Method Summary collapse
- #coerce(value) ⇒ Object
-
#initialize(name, klass, default = nil) ⇒ Modules
constructor
A new instance of Modules.
- #set(value) ⇒ Object
Methods inherited from LogStash::Setting
#==, #reset, #set?, #strict?, #to_hash, #validate_value, #value
Constructor Details
#initialize(name, klass, default = nil) ⇒ Modules
Returns a new instance of Modules.
609 610 611 |
# File 'lib/logstash/settings.rb', line 609 def initialize(name, klass, default = nil) super(name, klass, default, false) end |
Instance Method Details
#coerce(value) ⇒ Object
619 620 621 622 623 624 |
# File 'lib/logstash/settings.rb', line 619 def coerce(value) if value.is_a?(@klass) return value end @klass.new(value) end |
#set(value) ⇒ Object
613 614 615 616 617 |
# File 'lib/logstash/settings.rb', line 613 def set(value) @value = coerce(value) @value_is_set = true @value end |