Ruby 1.9.0 リファレンスマニュアル > ライブラリ一覧 > library matrix > class Vector > size
size() -> Fixnum
ベクトルの要素数(次元)を返します。