Class: IO

Inherits:
Object
  • Object
show all
Defined in:
lib/thor/core_ext/io_binary_read.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#binread(file, *args) ⇒ Object



3
4
5
6
7
8
# File 'lib/thor/core_ext/io_binary_read.rb', line 3

def binread(file, *args)
  fail ArgumentError, "wrong number of arguments (#{1 + args.size} for 1..3)" unless args.size < 3
  File.open(file, "rb") do |f|
    f.read(*args)
  end
end