Class: LogStash::Setting::TimeValue
- Inherits:
-
Coercible
- Object
- LogStash::Setting
- Coercible
- LogStash::Setting::TimeValue
- Defined in:
- lib/logstash/settings.rb
Instance Attribute Summary
Attributes inherited from LogStash::Setting
Instance Method Summary collapse
- #coerce(value) ⇒ Object
-
#initialize(name, default, strict = true, &validator_proc) ⇒ TimeValue
constructor
A new instance of TimeValue.
Methods inherited from Coercible
Methods inherited from LogStash::Setting
#==, #reset, #set, #set?, #strict?, #to_hash, #validate_value, #value
Constructor Details
#initialize(name, default, strict = true, &validator_proc) ⇒ TimeValue
Returns a new instance of TimeValue.
510 511 512 |
# File 'lib/logstash/settings.rb', line 510 def initialize(name, default, strict=true, &validator_proc) super(name, ::Integer, default, strict, &validator_proc) end |
Instance Method Details
#coerce(value) ⇒ Object
514 515 516 517 |
# File 'lib/logstash/settings.rb', line 514 def coerce(value) return value if value.is_a?(::Integer) Util::TimeValue.from_value(value).to_nanos end |