Method: FakeFS::Pathname#each_line
- Defined in:
- lib/fakefs/pathname.rb
#each_line(*args, &block) ⇒ Object
#each_line iterates over the line in the file. It yields a String object for each line.
This method has existed since 1.8.1.
615 616 617 618 619 620 621 622 623 |
# File 'lib/fakefs/pathname.rb', line 615 def each_line(*args, &block) # :yield: line if block_given? File.open(@path, 'r') do |io| io.each_line(*args, &block) end else enum_for(:each_line, *args) end end |