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.
552 553 554 |
# File 'lib/logstash/settings.rb', line 552 def initialize(name, default, strict=true, &validator_proc) super(name, ::Integer, default, strict, &validator_proc) end |
Instance Method Details
#coerce(value) ⇒ Object
556 557 558 559 |
# File 'lib/logstash/settings.rb', line 556 def coerce(value) return value if value.is_a?(::Integer) Util::TimeValue.from_value(value).to_nanos end |