Class: LogStash::Setting::Boolean
- Inherits:
-
Coercible
- Object
- LogStash::Setting
- Coercible
- LogStash::Setting::Boolean
- Defined in:
- lib/logstash/settings.rb
Overview
Specific settings #####
Instance Attribute Summary
Attributes inherited from LogStash::Setting
Instance Method Summary collapse
- #coerce(value) ⇒ Object
-
#initialize(name, default, strict = true, &validator_proc) ⇒ Boolean
constructor
A new instance of Boolean.
Methods inherited from Coercible
Methods inherited from LogStash::Setting
#==, #reset, #set, #set?, #strict?, #to_hash, #validate_value, #value
Methods included from Util::Loggable
included, #logger, #slow_logger
Constructor Details
#initialize(name, default, strict = true, &validator_proc) ⇒ Boolean
Returns a new instance of Boolean.
251 252 253 |
# File 'lib/logstash/settings.rb', line 251 def initialize(name, default, strict=true, &validator_proc) super(name, Object, default, strict, &validator_proc) end |
Instance Method Details
#coerce(value) ⇒ Object
255 256 257 258 259 260 261 262 263 264 |
# File 'lib/logstash/settings.rb', line 255 def coerce(value) case value when TrueClass, "true" true when FalseClass, "false" false else raise ArgumentError.new("could not coerce #{value} into a boolean") end end |