1030件ヒット
[1-100件を表示]
(0.135秒)
ライブラリ
- ビルトイン (817)
- bigdecimal (36)
- csv (36)
- matrix (48)
-
rexml
/ document (36) -
rubygems
/ version (12) - sdbm (24)
- set (9)
- win32ole (12)
クラス
-
ARGF
. class (72) - Array (48)
- BasicObject (36)
- BigDecimal (36)
- Bignum (9)
-
CSV
:: Row (12) -
CSV
:: Table (24) - Data (6)
-
Enumerator
:: Lazy (12) - Fixnum (3)
- Float (24)
-
Gem
:: Version (12) - Hash (88)
- Integer (40)
- MatchData (24)
- Matrix (48)
- Method (32)
- Numeric (60)
- Object (24)
- Proc (12)
-
Process
:: Status (12) -
REXML
:: Element (12) -
REXML
:: Instruction (12) -
REXML
:: XMLDecl (12) - Rational (12)
-
RubyVM
:: InstructionSequence (24) - SDBM (24)
- Set (12)
- String (240)
- Struct (24)
-
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (12)
キーワード
- != (12)
- % (12)
- +@ (10)
- -@ (10)
- === (47)
- [] (80)
- allbits? (8)
- call (16)
-
chunk
_ while (12) - crypt (12)
- dedup (3)
-
default
_ event _ sources (12) -
delete
_ if (72) - disasm (12)
- disassemble (12)
- div (12)
- divmod (24)
- each (36)
-
each
_ line (36) - eigen (12)
- eigensystem (12)
- eql? (54)
- equal? (12)
- filter! (14)
- hash (24)
- itself (12)
-
keep
_ if (19) - lazy (12)
- lup (12)
-
lup
_ decomposition (12) - modulo (12)
- nobits? (8)
- reject! (36)
- remainder (12)
-
root
_ node (12) - select! (24)
- slice (72)
- split (14)
-
to
_ h (19) -
to
_ hash (12) -
to
_ proc (12) -
unicode
_ normalize! (11)
検索結果
先頭5件
-
MatchData
# ==(other) -> bool (21253.0) -
self と other のマッチ対象になった文字列、元になった正規表現オブジェク ト、マッチした位置が等しければ true を返します。そうでない場合には false を返します。
...
self と other のマッチ対象になった文字列、元になった正規表現オブジェク
ト、マッチした位置が等しければ true を返します。そうでない場合には
false を返します。
@param other 比較対象のオブジェクトを指定します。
//emlis......t[文字列][ruby]{
s = "abc"
m1 = s.match("a")
m2 = s.match("b")
m1 == m2 # => false
m2 = s.match("a")
m1 == m2 # => true
//}
//emlist[正規表現][ruby]{
r = /abc/
m1 = r.match("abc") # => #<MatchData "abc">
m2 = r.match("abcde") # => #<MatchData "abc">
m1 == m2 # => false
m2 = r.match("abc......#<MatchData "abc">
m1 == m2 # => true
//}
//emlist[正規表現のマッチした位置][ruby]{
r = /abc/
m1 = r.match("abcabc") # => #<MatchData "abc">
m2 = r.match("abcabc", 3) # => #<MatchData "abc">
m1 == m2 # => false
m2 = r.match("abcabc", 0) # => #<MatchData "abc">
m1 == m2 # => true... -
Data
# ==(other) -> bool (21251.0) -
self と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。
...
self と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。
@param other self と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
Dog = Data.def......new("Fred", 5)
dog2 = Dog.new("Fred", 5.0)
p 5 == 5.0 # => true
p 5.eql?(5.0) # => false
p dog1 == dog2 # => true
p dog1.eql?(dog2) # => false
p dog1.equal?(dog2) # => false
//}
[注意] 本メソッドの記述は Data のサブクラスのインスタンスに対......して呼び
出す事を想定しています。Data.define は Data のサブクラスを作成する点に
注意してください。
@see Object#==, Data#eql?... -
Struct
# ==(other) -> bool (21245.0) -
self と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。
...
self と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。
@param other self と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
Dog = Struct.n......, 5)
p dog1 == dog2 #=> true
p dog1.eql?(dog2) #=> true
p dog1.equal?(dog2) #=> false
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位......クラスを作成する点に
注意してください。
@see Struct#eql?... -
Float
# ==(other) -> bool (21237.0) -
比較演算子。数値として等しいか判定します。
...am other 比較対象の数値
@return self と other が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
3.14 == 3.14000 # => true
3.14 == 3.1415 # => false
//}
NaNどうしの比較は、未定義です。
//emlist[......例][ruby]{
Float::NAN == Float::NAN # => false
[Float::NAN] == [Float::NAN] # => true
[Float::NAN] == [0.0 / 0.0] # => false
//}... -
Rational
# ==(other) -> bool (21237.0) -
数値として等しいか判定します。
...other 自身と比較する数値
@return self と other が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[例][ruby]{
Rational(2, 3) == Rational(2, 3) # => true
Rational(5) == 5 # => true
Rational(0) ==......0.0 # => true
Rational('1/3') == 0.33 # => false
Rational('1/2') == '1/2' # => false
//}... -
String
# ==(other) -> bool (21231.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false......m 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
raise
end
p "string".eql?(strin......glike) #=> false
p "string" == stringlike #=> true
//}
@see String#eql?... -
BasicObject
# ==(other) -> bool (21219.0) -
オブジェクトが other と等しければ真を、そうでない場合は偽を返します。
...オブジェクトが other と等しければ真を、そうでない場合は偽を返します。
このメソッドは各クラスの性質に合わせて、サブクラスで再定義するべきです。
多くの場合、オブジェクトの内容が等しければ真を返すように (同......ルトでは Object#equal? と同じオブジェクトの同一性になっています。
@param other 比較対象となるオブジェクト
@return other が self と同値であれば真、そうでない場合は偽
//emlist[例][ruby]{
class Person < BasicObject
def initialize(name, age)......@name = name
@age = age
end
end
tanaka1 = Person.new("tanaka", 24)
tanaka2 = Person.new("tanaka", 24)
tanaka1 == tanaka1 #=> true
tanaka1 == tanaka2 #=> false
//}
@see BasicObject#equal?, Object#==, Object#equal?,
Object#eql?... -
Integer
# ==(other) -> bool (21219.0) -
比較演算子。数値として等しいか判定します。
...比較演算子。数値として等しいか判定します。
@param other 比較対象の数値
@return self と other が等しい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 == 2 # => false
1 == 1.0 # => true
//}... -
Set
# ==(set) -> bool (21219.0) -
2 つの集合が等しいときに true を返します。
...2 つの集合が等しいときに true を返します。
より厳密には、引数 set が Set オブジェクトであり、self と set が同数の
要素を持ち、かつそれらの要素がすべて等しい場合に true となります。
それ以外の場合には、false を返し......ます。
要素の等しさは Object#eql? により判定されます。
@param set 比較対象のオブジェクトを指定します。
//emlist[][ruby]{
require 'set'
s1 = Set[10, 20, 30]
s2 = Set[10, 30, 40]
s3 = Set[30, 10, 30, 20]
p s1 == s2 # => false
p s1 == s3 # => true
//}......ます。
要素の等しさは Object#eql? により判定されます。
@param set 比較対象のオブジェクトを指定します。
//emlist[][ruby]{
s1 = Set[10, 20, 30]
s2 = Set[10, 30, 40]
s3 = Set[30, 10, 30, 20]
p s1 == s2 # => false
p s1 == s3 # => true
//}... -
REXML
:: Instruction # ==(other) -> bool (21217.0) -
other と self が同じ 処理命令である場合に真を返します。
...other と self が同じ 処理命令である場合に真を返します。
同じとは、 REXML::Instruction#target と REXML::Instruction#content
が一致することを意味します。
@param other 比較対象...