each_byte

ARGF.bytes {|byte| block } â ARGF
ARGF.bytes â an_enumerator
ARGF.each_byte {|byte| block } â ARGF
ARGF.each_byte â an_enumerator
Instance Public methods
Iterates over each byte of each file in +ARGV+.
A byte is returned as a +Fixnum+ in the range 0..255.

This method allows you to treat the files supplied on the command line as
a single file consisting of the concatenation of each named file. After
the last byte of the first file has been returned, the first byte of the
second file is returned. The +ARGF.filename+ method can be used to
determine the filename of the current byte.

If no block is given, an enumerator is returned instead.

For example:

ARGF.bytes.to_a  #=> [35, 32, ... 95, 10]
doc_ruby_on_rails
2015-03-30 10:58:36
Comments
Leave a Comment

Please login to continue.