Ruby 1.9.0 リファレンスマニュアル > ライブラリ一覧 > library _builtin > class IO > bytes

instance method IO#bytes

bytes -> Enumerable::Enumerator

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

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