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.
567 568 569 |
# File 'lib/logstash/settings.rb', line 567 def initialize(name, klass, default = nil) super(name, klass, default, false) end |
Instance Method Details
#coerce(value) ⇒ Object
577 578 579 580 581 582 |
# File 'lib/logstash/settings.rb', line 577 def coerce(value) if value.is_a?(@klass) return value end @klass.new(value) end |
#set(value) ⇒ Object
571 572 573 574 575 |
# File 'lib/logstash/settings.rb', line 571 def set(value) @value = coerce(value) @value_is_set = true @value end |