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

instance method IO#bytes

bytes -> Enumerable::Enumerator

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

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