Class: Whenever::Log

Inherits:
Object
  • Object
show all
Defined in:
app/models/whenever/log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#kindObject (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

#clearObject



18
19
20
# File 'app/models/whenever/log.rb', line 18

def clear
  File.write(@path, nil)
end

#nameObject



10
11
12
# File 'app/models/whenever/log.rb', line 10

def name
  "#{@kind}_log"
end

#tailObject



14
15
16
# File 'app/models/whenever/log.rb', line 14

def tail
  File.read(@path)
end