Class: IO

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#binread(file, *args) ⇒ Object

Raises:

  • (ArgumentError)

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

def binread(file, *args)
  raise 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