Class: Minx::FileChannel

Inherits:
IOChannel show all
Defined in:
lib/minx/file_channel.rb

Instance Method Summary (collapse)

Methods inherited from IOChannel

#<<, #each, #read, #write

Constructor Details

- (FileChannel) initialize(filename, options = {})

Open a new file channel.

The lines of the file will be returned upon calls to IOChannel#read.

Parameters:

  • filename (String)
  • options (Hash) (defaults to: {})

Options Hash (options):

  • :mode (String) — default: "r"

    the file access mode



13
14
15
16
17
# File 'lib/minx/file_channel.rb', line 13

def initialize(filename, options = {})
  options[:mode] ||= 'r'

  super(::File.new(filename, options[:mode]))
end