るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.015秒)
トップページ > クラス:Object[x] > クエリ:NIL[x] > クエリ:TRUE[x] > バージョン:2.5.0[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin nil?
  2. object nil?
  3. nilclass nil?
  4. object nil
  5. _builtin nil

ライブラリ

キーワード

検索結果

Object#nil? -> bool (18430.0)

レシーバが nil であれば真を返します。

レシーバが nil であれば真を返します。

p false.nil? #=> false
p nil.nil? #=> true

@see NilClass

Object#singleton_class -> Class (61.0)

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

...します。

@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#!~(other) -> bool (43.0)

自身が other とマッチしない事を判定します。

自身が other とマッチしない事を判定します。

self#=~(obj) を反転した結果と同じ結果を返します。

@param other 判定するオブジェクトを指定します。

//emlist[例][ruby]{
obj = 'regexp'
p (obj !~ /re/) # => false

obj = nil
p (obj !~ /re/) # => true
//}