るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.039秒)
トップページ > クラス:Object[x] > クエリ:Integer[x] > クエリ:class[x]

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer times
  5. integer chr

ライブラリ

キーワード

検索結果

Object#class -> Class (18263.0)

レシーバのクラスを返します。

...レシーバのクラスを返します。

//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}

@see Class#superclass,Object#kind_of?,Object#instance_of?...

Object#singleton_class -> Class (6245.0)

レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。

...れ NilClass, TrueClass,
FalseClass を返します。

@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。

//emlist[][ruby]{
Object
.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String.singleton_class #=> #<Class:String>
nil.singleton_class...
...#=> NilClass
//}

@see Object#class...

Object#to_int -> Integer (130.0)

オブジェクトの Integer への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。

...オブジェクトの Integer への暗黙の変換が必要なときに内部で呼ばれます。
デフォルトでは定義されていません。

説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
...
...が使われるすべての場面で代置可能であるような、
* 整数そのものとみなせるようなもの
という厳しいものになっています。

//emlist[][ruby]{
class
Foo
def to_int
1
end
end

ary = [:a, :b, :c]
p(ary[Foo.new]) # => :b
//}

@see Kernel.#Integer...

Object#public_method(name) -> Method (19.0)

オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。

...vate メソッド名を引数として与えると発生します。

//emlist[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public_method(:p) # method `p' for class `Integer' is private (NameError)
//}

@see Object#method,Object#public_send,Module#public_instance_method...