Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > IOクラス > bytes

instance method IO#bytes

bytes -> Enumerator

自身を 1 バイトずつ整数としてイテレートするような Enumerator オブジェクトを生成して返します。

"hello".bytes.to_a        #=> [104, 101, 108, 108, 111]
class IO