Class: LogStash::PluginMixins::Jdbc::TimeValueTracker

Inherits:
ValueTracking
  • Object
show all
Defined in:
lib/logstash/plugin_mixins/jdbc/value_tracking.rb

Constant Summary

Constants inherited from ValueTracking

ValueTracking::YAML_PERMITTED_CLASSES

Instance Attribute Summary

Attributes inherited from ValueTracking

#value

Instance Method Summary collapse

Methods inherited from ValueTracking

build_last_value_tracker, #initialize, load_yaml, #write

Constructor Details

This class inherits a constructor from LogStash::PluginMixins::Jdbc::ValueTracking

Instance Method Details

#set_initialObject



99
100
101
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 99

def set_initial
  common_set_initial(:to_time, Time.at(0).utc)
end

#set_value(value) ⇒ Object



103
104
105
106
107
108
109
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 103

def set_value(value)
  if value.respond_to?(:to_time)
    @value = value.to_time
  else
    @value = DateTime.parse(value).to_time
  end
end