るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.088秒)

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

クラス

検索結果

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
//}...