Class: Logger
- Inherits:
-
Object
- Object
- Logger
- Defined in:
- lib/aniview/util/logger.rb
Instance Method Summary collapse
-
#initialize(file) ⇒ Logger
constructor
A new instance of Logger.
- #log(string) ⇒ Object
Constructor Details
#initialize(file) ⇒ Logger
Returns a new instance of Logger.
2 3 4 5 |
# File 'lib/aniview/util/logger.rb', line 2 def initialize(file) @logfile = file open(@logfile, 'w') { |f| f.puts "initialized..." } end |
Instance Method Details
#log(string) ⇒ Object
6 7 8 |
# File 'lib/aniview/util/logger.rb', line 6 def log(string) open(@logfile, 'a') { |f| f.puts string } end |