48件ヒット
[1-48件を表示]
(0.088秒)
検索結果
-
Numeric
# to _ int -> Integer (24242.0) -
self.to_i と同じです。
...self.to_i と同じです。
//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//}... -
Object
# to _ int -> Integer (24220.0) -
オブジェクトの Integer への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...が使われるすべての場面で代置可能であるような、
* 整数そのものとみなせるようなもの
という厳しいものになっています。
//emlist[][ruby]{
class Foo
def to_int
1
end
end
ary = [:a, :b, :c]
p(ary[Foo.new]) # => :b
//}
@see Kernel.#Integer... -
Integer
# to _ int -> self (21221.0) -
self を返します。
...self を返します。
//emlist[][ruby]{
10.to_i # => 10
//}... -
Integer
# to _ i -> self (18121.0) -
self を返します。
...self を返します。
//emlist[][ruby]{
10.to_i # => 10
//}...