Class: LastValueStore
- Inherits:
-
Object
- Object
- LastValueStore
- Defined in:
- lib/logstash/test.rb,
lib/logstash/inputs/mongoprofile.rb
Instance Method Summary collapse
- #get_last_value ⇒ Object
-
#initialize(path, name) ⇒ LastValueStore
constructor
A new instance of LastValueStore.
- #save_last_value(value) ⇒ Object
Constructor Details
#initialize(path, name) ⇒ LastValueStore
Returns a new instance of LastValueStore.
120 121 122 |
# File 'lib/logstash/test.rb', line 120 def initialize(path, name) @file_full_name = "#{path}/#{name}" end |
Instance Method Details
#get_last_value ⇒ Object
133 134 135 |
# File 'lib/logstash/test.rb', line 133 def get_last_value File.read(@file_full_name) end |
#save_last_value(value) ⇒ Object
124 125 126 127 128 129 130 131 |
# File 'lib/logstash/test.rb', line 124 def save_last_value(value) file = File.open(@file_full_name, 'a+') file.truncate(0) file.puts(value) file.close end |