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
Methods included from Util::Loggable
included, #logger, #slow_logger
Constructor Details
permalink #initialize(name, default, strict = true, &validator_proc) ⇒ TimeValue
Returns a new instance of TimeValue.
502 503 504 |
# File 'lib/logstash/settings.rb', line 502 def initialize(name, default, strict=true, &validator_proc) super(name, ::Fixnum, default, strict, &validator_proc) end |
Instance Method Details
permalink #coerce(value) ⇒ Object
[View source]
506 507 508 509 |
# File 'lib/logstash/settings.rb', line 506 def coerce(value) return value if value.is_a?(::Fixnum) Util::TimeValue.from_value(value).to_nanos end |