Class: TasksScheduler::Checker::Log
- Inherits:
-
Object
- Object
- TasksScheduler::Checker::Log
- Defined in:
- lib/tasks_scheduler/checker/log.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Class Method Summary collapse
Instance Method Summary collapse
- #dirname ⇒ Object
- #exist? ⇒ Boolean
-
#initialize(key) ⇒ Log
constructor
A new instance of Log.
- #path ⇒ Object
Constructor Details
#initialize(key) ⇒ Log
16 17 18 19 |
# File 'lib/tasks_scheduler/checker/log.rb', line 16 def initialize(key) @key = key ::FileUtils.mkdir_p(dirname) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
14 15 16 |
# File 'lib/tasks_scheduler/checker/log.rb', line 14 def key @key end |
Class Method Details
.logs_directory ⇒ Object
9 10 11 |
# File 'lib/tasks_scheduler/checker/log.rb', line 9 def logs_directory @logs_directory ||= ::Rails.root.join('log', 'tasks_scheduler', 'checker') end |
Instance Method Details
#dirname ⇒ Object
21 22 23 |
# File 'lib/tasks_scheduler/checker/log.rb', line 21 def dirname ::File.dirname(path) end |
#exist? ⇒ Boolean
25 26 27 |
# File 'lib/tasks_scheduler/checker/log.rb', line 25 def exist? ::File.exist?(path) end |
#path ⇒ Object
29 30 31 |
# File 'lib/tasks_scheduler/checker/log.rb', line 29 def path self.class.logs_directory.join("#{key}.log") end |