Sha256: 67af61b7420c6b3e0b92cf36c0666817a6a53600d1b01a27926addbcfea22723

Contents?: true

Size: 444 Bytes

Versions: 1

Compression:

Stored size: 444 Bytes

Contents

module IOStreams
  module File
    class Writer
      # Write to a named file
      # TODO: Add support for mode (text / binary), permissions, buffering, append
      # TODO: Add encoding support: external_encoding, internal_encoding
      def self.open(file_name, _=nil, &block)
        raise(ArgumentError, 'File name must be a string') unless file_name.is_a?(String)

        ::File.open(file_name, 'wb', &block)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iostreams-0.15.0 lib/io_streams/file/writer.rb