class LearnOpen::Logger

Attributes

log_path[R]

Public Class Methods

new(log_path) click to toggle source
# File lib/learn_open/services/logger.rb, line 5
def initialize(log_path)
  @log_path = log_path
  setup
end

Public Instance Methods

log(message) click to toggle source
# File lib/learn_open/services/logger.rb, line 10
def log(message)
  File.write(log_path, message)
end

Private Instance Methods

setup() click to toggle source
# File lib/learn_open/services/logger.rb, line 18
def setup
  FileUtils.touch(log_path)
  File.write(log_path, '')
end