Class: Buncho::BaseLogger
- Inherits:
-
Object
- Object
- Buncho::BaseLogger
- Defined in:
- lib/buncho/base_logger.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ BaseLogger
constructor
A new instance of BaseLogger.
- #read_lines ⇒ Object
Constructor Details
#initialize(path) ⇒ BaseLogger
Returns a new instance of BaseLogger.
5 6 7 8 |
# File 'lib/buncho/base_logger.rb', line 5 def initialize(path) @path = File.(path, __FILE__) @io = File.open(path, "a+") end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/buncho/base_logger.rb', line 3 def path @path end |
Instance Method Details
#read_lines ⇒ Object
10 11 12 13 |
# File 'lib/buncho/base_logger.rb', line 10 def read_lines @io.rewind File.exist?(@path) ? @io.read.split("\n") : [] end |