Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > stringioライブラリ > StringIOクラス > bytes
each_byte {|ch| ... } -> selfbytes {|ch| ... } -> selfeach_byte -> Enumerable::Enumeratorbytes -> Enumerable::Enumerator自身から 1 バイトずつ読み込み、整数 ch に変換し、それを引数として与えられたブロックを実行します。
a = StringIO.new("hoge")
a.each_byte{|ch| p ch }
#=>
104
111
103
101