Sha256: 5f0d5ca47d244015ec5a5dd845c784bd58c303f38f2392682d59928ebcdd3d94

Contents?: true

Size: 329 Bytes

Versions: 4

Compression:

Stored size: 329 Bytes

Contents

module IOStreams
  module File
    class Reader
      # Read from a file or stream
      def self.open(file_name_or_io, _=nil, &block)
        unless file_name_or_io.respond_to?(:read)
          ::File.open(file_name_or_io, 'rb', &block)
        else
          block.call(file_name_or_io)
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iostreams-0.8.2 lib/io_streams/file/reader.rb
iostreams-0.8.1 lib/io_streams/file/reader.rb
iostreams-0.8.0 lib/io_streams/file/reader.rb
iostreams-0.7.0 lib/io_streams/file/reader.rb