Class: Rblock::Logfile
- Inherits:
-
Object
- Object
- Rblock::Logfile
- Defined in:
- lib/rblock/logfile.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Instance Method Summary collapse
- #gets ⇒ Object
-
#initialize(file_name) ⇒ Logfile
constructor
A new instance of Logfile.
Constructor Details
#initialize(file_name) ⇒ Logfile
Returns a new instance of Logfile.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rblock/logfile.rb', line 5 def initialize(file_name) @line = nil FileUtils.touch(file_name) @file = File.new(file_name) while @file.gets # do nothing, just wait to get to end of log file end self end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
3 4 5 |
# File 'lib/rblock/logfile.rb', line 3 def line @line end |
Instance Method Details
#gets ⇒ Object
18 19 20 |
# File 'lib/rblock/logfile.rb', line 18 def gets @line = @file.gets end |