種類
- インスタンスメソッド (1036)
- 定数 (256)
- 特異メソッド (26)
ライブラリ
- ビルトイン (1185)
-
minitest
/ spec (16) - optparse (13)
- pp (65)
- psych (39)
キーワード
- !~ (13)
- <=> (13)
- == (13)
- === (13)
- =~ (9)
- ARGF (13)
- ARGV (13)
- DATA (13)
- ENV (13)
- FALSE (8)
- NIL (8)
-
RUBY
_ COPYRIGHT (13) -
RUBY
_ DESCRIPTION (13) -
RUBY
_ ENGINE (13) -
RUBY
_ ENGINE _ VERSION (11) -
RUBY
_ PATCHLEVEL (13) -
RUBY
_ PLATFORM (13) -
RUBY
_ RELEASE _ DATE (13) -
RUBY
_ REVISION (13) -
RUBY
_ VERSION (13) -
SCRIPT
_ LINES _ _ (13) - STDERR (13)
- STDIN (13)
- STDOUT (13)
-
TOPLEVEL
_ BINDING (13) - TRUE (8)
-
_ dump (13) - class (13)
- clone (13)
-
define
_ singleton _ method (26) - display (13)
- dup (13)
-
enum
_ for (26) - eql? (13)
- equal? (13)
- extend (13)
- freeze (13)
- frozen? (13)
- hash (13)
- initialize (13)
-
initialize
_ clone (13) -
initialize
_ copy (13) -
initialize
_ dup (13) - inspect (13)
-
instance
_ of? (13) -
instance
_ variable _ defined? (13) -
instance
_ variable _ get (13) -
instance
_ variable _ set (13) -
instance
_ variables (13) -
is
_ a? (13) - itself (13)
-
kind
_ of? (13) -
marshal
_ dump (13) -
marshal
_ load (13) - method (13)
- methods (13)
-
must
_ be (1) -
must
_ be _ close _ to (1) -
must
_ be _ empty (1) -
must
_ be _ instance _ of (1) -
must
_ be _ kind _ of (1) -
must
_ be _ nil (1) -
must
_ be _ same _ as (1) -
must
_ be _ within _ delta (1) -
must
_ be _ within _ epsilon (1) -
must
_ equal (1) -
must
_ include (1) -
must
_ match (1) -
must
_ raise (1) -
must
_ respond _ to (1) -
must
_ send (1) -
must
_ throw (1) - new (13)
- nil? (13)
-
object
_ id (13) -
pretty
_ inspect (13) -
pretty
_ print (13) -
pretty
_ print _ cycle (13) -
pretty
_ print _ inspect (13) -
pretty
_ print _ instance _ variables (13) -
private
_ methods (13) -
protected
_ methods (13) -
psych
_ to _ yaml (13) -
public
_ method (13) -
public
_ methods (13) -
public
_ send (26) -
remove
_ instance _ variable (13) -
respond
_ to? (13) -
respond
_ to _ missing? (13) - send (26)
-
singleton
_ class (13) -
singleton
_ method (13) -
singleton
_ methods (13) - taint (9)
- tainted? (9)
- tap (13)
- then (16)
-
to
_ a (13) -
to
_ ary (13) -
to
_ enum (26) -
to
_ hash (13) -
to
_ int (13) -
to
_ io (13) -
to
_ proc (13) -
to
_ regexp (13) -
to
_ s (13) -
to
_ str (13) -
to
_ yaml (13) - trust (9)
- untaint (9)
- untrust (9)
- untrusted? (9)
-
yaml
_ tag (13) -
yield
_ self (18)
検索結果
先頭5件
-
Object
# !~(other) -> bool (1.0) -
自身が other とマッチしない事を判定します。
自身が other とマッチしない事を判定します。
self#=~(obj) を反転した結果と同じ結果を返します。
@param other 判定するオブジェクトを指定します。
//emlist[例][ruby]{
obj = 'regexp'
p (obj !~ /re/) # => false
obj = nil
p (obj !~ /re/) # => true
//} -
Object
# <=>(other) -> 0 | nil (1.0) -
self === other である場合に 0 を返します。そうでない場合には nil を返します。
...self === other である場合に 0 を返します。そうでない場合には nil を返します。
//emlist[例][ruby]{
a = Object.new
b = Object.new
a <=> a # => 0
a <=> b # => nil
//}
@see Object#===... -
Object
# ==(other) -> bool (1.0) -
オブジェクトと other が等しければ真を返します。
...ト
の同一性判定になっています。
@param other 比較するオブジェクトです。
//emlist[例][ruby]{
o = Object.new
p(o.eql?(o)) #=> true
p(o.eql?(Object.new)) #=> false
//}
下記の例のように、各クラスの性質に合わせて再定義されることが期待され......ています。
//emlist[適切に再定義されている例][ruby]{
p("foo" == "bar") #=> false
p("foo" == "foo") #=> true
p(4 == 4) #=> true
p(4 == 4.0) #=> true
//}
@see Object#equal?,Object#eql?... -
Object
# ===(other) -> bool (1.0) -
case 式で使用されるメソッドです。d:spec/control#case も参照してください。
...ドは case 式での振る舞いを考慮して、
各クラスの性質に合わせて再定義すべきです。
デフォルトでは内部で Object#== を呼び出します。
when 節の式をレシーバーとして === を呼び出すことに注意してください。
また Enumerable......String class. But don't hit."
else
"unknown"
end
end
puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's world>
//}
@see Object#==, Range#===, Module#===, Regexp#===, Enumerable#grep... -
Object
# =~(other) -> nil (1.0) -
右辺に正規表現オブジェクトを置いた正規表現マッチ obj =~ /RE/ をサポートするためのメソッドです。常に nil を返します。
右辺に正規表現オブジェクトを置いた正規表現マッチ obj =~ /RE/
をサポートするためのメソッドです。常に nil を返します。
このメソッドは Ruby 2.6 から deprecated です。
この定義により、=~ が再定義されたオブジェクトでは正常にマッチを行い、
それ以外のものは nil を返すようになります。
@param other 任意のオブジェクトです。結果に影響しません。
//emlist[例][ruby]{
obj = 'regexp'
p(obj =~ /re/) #=> 0
obj = nil
p(obj =~ /re/) #=> nil
//}
...右辺に正規表現オブジェクトを置いた正規表現マッチ obj =~ /RE/
をサポートするためのメソッドです。常に nil を返します。
このメソッドは Ruby 2.6 から deprecated です。
意図せずに Array などに対して呼ばれた時にバグの原因になっていたため、
代わりに NilClass#=~ が定義されています。
@param other 任意のオブジェクトです。結果に影響しません。
//emlist[例][ruby]{
obj = 'regexp'
p(obj =~ /re/) #=> 0
obj = nil
p(obj =~ /re/) #=> nil
... -
Object
# _ dump(limit) -> String (1.0) -
Marshal.#dump において出力するオブジェクトがメソッド _dump を定義している場合には、そのメソッドの結果が書き出されます。
...ッド _dump
を定義している場合には、そのメソッドの結果が書き出されます。
バージョン1.8.0以降ではObject#marshal_dump, Object#marshal_loadの使用
が推奨されます。 Marshal.dump するオブジェクトが _dump と marshal_dump の両方の
メソッ......い場合や拡張ライブラリで定義し
たクラスのインスタンスがインスタンス変数以外に情報を保持する場合に
利用します。(例えば、クラス Time は、_dump/_load を定義して
います)
@see Object#marshal_dump, Object#marshal_load, Class#_load... -
Object
# class -> Class (1.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
# clone(freeze: nil) -> object (1.0) -
オブジェクトの複製を作成して返します。
..._d) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......d) #=> true
p(obj_d.tainted?) #=> false
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......obj_d)) #=> false
p(obj == obj_d) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの...
