Class: ValueTracking
- Inherits:
-
Object
- Object
- ValueTracking
- Defined in:
- lib/logstash/inputs/value_tracking.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #get_initial ⇒ Object
-
#initialize(handler) ⇒ ValueTracking
constructor
A new instance of ValueTracking.
- #set_value(value) ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize(handler) ⇒ ValueTracking
Returns a new instance of ValueTracking.
17 18 19 20 |
# File 'lib/logstash/inputs/value_tracking.rb', line 17 def initialize(handler) @file_handler = handler set_value(get_initial) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
15 16 17 |
# File 'lib/logstash/inputs/value_tracking.rb', line 15 def value @value end |
Class Method Details
.build_last_value_tracker(plugin) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/logstash/inputs/value_tracking.rb', line 4 def self.build_last_value_tracker(plugin) handler = NullFileHandler.new(plugin.) if plugin.record_last_run handler = FileHandler.new(plugin.) end if plugin.clean_run handler.clean end instance = DateTimeValueTracker.new(handler) end |
Instance Method Details
#get_initial ⇒ Object
22 23 24 |
# File 'lib/logstash/inputs/value_tracking.rb', line 22 def get_initial # override in subclass end |
#set_value(value) ⇒ Object
26 27 28 |
# File 'lib/logstash/inputs/value_tracking.rb', line 26 def set_value(value) # override in subclass end |
#write ⇒ Object
30 31 32 |
# File 'lib/logstash/inputs/value_tracking.rb', line 30 def write @file_handler.write(@value.to_s) end |