Class: Eye::Checker::FileTouched
- Inherits:
-
Eye::Checker
- Object
- Eye::Checker
- Eye::Checker::FileTouched
- Defined in:
- lib/eye/checker/file_touched.rb
Constant Summary
Constants inherited from Eye::Checker
Instance Attribute Summary
Attributes inherited from Eye::Checker
#check_count, #options, #pid, #process, #type, #value, #values
Instance Method Summary collapse
- #get_value ⇒ Object
- #good?(value) ⇒ Boolean
-
#initialize(*args) ⇒ FileTouched
constructor
A new instance of FileTouched.
Methods inherited from Eye::Checker
#check, #check_name, create, #defer, #fire, get_class, #get_value_safe, #human_value, #inspect, #last_human_values, #logger_sub_tag, #logger_tag, #max_tries, #min_tries, name_and_class, #previous_value, register, requires, #run_in_process_context, validate!
Methods included from Dsl::Validation
Constructor Details
#initialize(*args) ⇒ FileTouched
Returns a new instance of FileTouched.
6 7 8 9 |
# File 'lib/eye/checker/file_touched.rb', line 6 def initialize(*args) super self.file = process.(file) if process && file end |
Instance Method Details
#get_value ⇒ Object
11 12 13 |
# File 'lib/eye/checker/file_touched.rb', line 11 def get_value File.exist?(file) end |
#good?(value) ⇒ Boolean
15 16 17 18 |
# File 'lib/eye/checker/file_touched.rb', line 15 def good?(value) File.delete(file) if value && delete !value end |