るりまサーチ

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

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

URI::Generic#==(uri) -> bool (24213.0)

引数に指定した URI (文字列またはURIオブジェクト)との一致判定を行い ます。URI は正規化して比較されます。

...た URI (文字列またはURIオブジェクト)との一致判定を行い
ます。URI は正規化して比較されます。

@
param uri 比較したい URI を URI オブジェクトで指定します。

例:
r
equire 'uri'
u1 = URI.parse('http://example.com/?hoge')
u2 = URI.parse('http:...
...//Example.Com/?hoge')
p u1 == u2 #=> true...

Random#==(other) -> bool (21285.0)

乱数生成器が等しい状態であるならばtrue を返します。

...乱数生成器が等しい状態であるならばtrue を返します。

@
param other 比較対象の乱数生成器


//emlist[例][ruby]{
r
1 = Random.new(1)
r
2 = Random.new(1)

p r1 == r2 # => true
r
2.rand
p r1 == r2 # => false
r
1.rand
p r1 == r2 # => true
//}...

Array#==(other) -> bool (21247.0)

自身と other の各要素をそれぞれ順に == で比較し て、全要素が等しければ true を返します。そうでない場合には false を返します。

...と other の各要素をそれぞれ順に == で比較し
て、全要素が等しければ true を返します。そうでない場合には false を返します。

@
param other 自身と比較したい配列を指定します。

@
see Object#==

//emlist[例][ruby]{
[ "a", "c" ] == [ "a",...
..."c", 7 ] #=> false
[ "a", "c", 7 ] == [ "a", "c", 7 ] #=> true
[ "a", "c", 7 ] == [ "a", "d", "f" ] #=> false
//}...

Rational#==(other) -> bool (21243.0)

数値として等しいか判定します。

...

@
param other 自身と比較する数値

@
return self と other が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[例][ruby]{
R
ational(2, 3) == Rational(2, 3) # => true
R
ational(5) == 5 # => true
R
ational...
...(0) == 0.0 # => true
R
ational('1/3') == 0.33 # => false
R
ational('1/2') == '1/2' # => false
//}...

String#==(other) -> bool (21243.0)

other が文字列の場合、String#eql? と同様に文字列の内容を比較します。

...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。

other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false...
...

@
param other 任意のオブジェクト
@
return true か false

//emlist[例][ruby]{
stringlike = Object.new

def stringlike.==(other)
"string" == other
end

p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> false

def stringlike.to_str
r
aise
end

p "string"....
...eql?(stringlike) #=> false
p "string" == stringlike #=> true
//}

@
see String#eql?...

絞り込み条件を変える

Range#==(other) -> bool (21241.0)

指定された other が Range クラスのインスタンスであり、 始端と終端が == メソッドで比較して等しく、Range#exclude_end? が同じ場合に true を返します。そうでない場合に false を返します。

...指定された other Range クラスのインスタンスであり、
始端と終端が == メソッドで比較して等しく、Range#exclude_end? が同じ場合に
true を返します。そうでない場合に false を返します。

@
param other 自身と比較したいオブジェ...
...クトを指定します。

//emlist[例][ruby]{
p (1..2) == (1..2) # => true
p (1..2) == (1...2) # => false
p (1..2) == Range.new(1.0, 2.0) # => true
//}...

Struct#==(other) -> bool (21235.0)

self と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。

...f と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。

@
param other self と比較したいオブジェクトを指定します。

//emlist[例][ruby]{
Dog = Struct.new(:...
...red", 5)
dog2 = Dog.new("fred", 5)

p dog1 == dog2 #=> true
p dog1.eql?(dog2) #=> true
p dog1.equal?(dog2) #=> false
//}

[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Str...
...uct.new は Struct の下位クラスを作成する点に
注意してください。

@
see Struct#eql?...

Regexp#==(other) -> bool (21231.0)

otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。

...otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。

@
param other 正規表現を指定します。

//emlist[例][ruby]{
p /^eee$/ == /~eee$/x # => false
p /^eee$/ == /~eee$/i # => false
p /^eee$/e == /~eee$/u # => false
p /^...
...eee$/ == Regexp.new("^eee$") # => true
p /^eee$/.eql?(/^eee$/) # => true
//}...

Integer#==(other) -> bool (21225.0)

比較演算子。数値として等しいか判定します。

...比較演算子。数値として等しいか判定します。

@
param other 比較対象の数値
@
return self と other が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 == 2 # => false
1 == 1.0 # => true
//}...
<< 1 2 3 ... > >>