Class: LogStash::PluginMixins::Jdbc::DateTimeValueTracker

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



85
86
87
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 85

def set_initial
  common_set_initial(:to_datetime, DateTime.new(1970))
end

#set_value(value) ⇒ Object



89
90
91
92
93
94
95
# File 'lib/logstash/plugin_mixins/jdbc/value_tracking.rb', line 89

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