Class: Whenever::Log
- Inherits:
-
Object
- Object
- Whenever::Log
- Defined in:
- app/models/whenever/log.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize(kind, path) ⇒ Log
constructor
A new instance of Log.
- #name ⇒ Object
- #tail ⇒ Object
Constructor Details
#initialize(kind, path) ⇒ Log
Returns a new instance of Log.
5 6 7 8 |
# File 'app/models/whenever/log.rb', line 5 def initialize kind, path @kind = kind @path = path end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
3 4 5 |
# File 'app/models/whenever/log.rb', line 3 def kind @kind end |
Instance Method Details
#clear ⇒ Object
18 19 20 |
# File 'app/models/whenever/log.rb', line 18 def clear File.write(@path, nil) end |
#name ⇒ Object
10 11 12 |
# File 'app/models/whenever/log.rb', line 10 def name "#{@kind}_log" end |
#tail ⇒ Object
14 15 16 |
# File 'app/models/whenever/log.rb', line 14 def tail File.read(@path) end |