Method: MemFs::IO#each

Defined in:
lib/memfs/io.rb

#each(sep = $/) ⇒ Object



125
126
127
128
129
130
# File 'lib/memfs/io.rb', line 125

def each(sep = $/)
  return to_enum(__callee__) unless block_given?
  fail IOError, 'not opened for reading' unless readable?
  content.each_line(sep) { |line| yield(line) }
  self
end