Class: Heel::Logger
- Inherits:
-
Object
- Object
- Heel::Logger
- Defined in:
- lib/heel/logger.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(filename) ⇒ Logger
constructor
A new instance of Logger.
- #write(msg) ⇒ Object
Constructor Details
#initialize(filename) ⇒ Logger
Returns a new instance of Logger.
4 5 6 |
# File 'lib/heel/logger.rb', line 4 def initialize( filename ) @filename = File.( filename ) end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
3 4 5 |
# File 'lib/heel/logger.rb', line 3 def filename @filename end |
Instance Method Details
#write(msg) ⇒ Object
8 9 10 11 12 |
# File 'lib/heel/logger.rb', line 8 def write( msg ) File.open( filename, "ab" ) do |f| f.write( msg ) end end |