別のキーワード
ライブラリ
- ビルトイン (1878)
- bigdecimal (48)
- csv (48)
- digest (24)
- openssl (12)
- pathname (36)
- prime (24)
- rake (24)
-
rubygems
/ requirement (36) -
rubygems
/ version (12) - set (24)
- win32ole (12)
クラス
- Array (219)
- BasicObject (48)
- BigDecimal (48)
- Binding (12)
-
CSV
:: Row (12) -
CSV
:: Table (36) - Complex (12)
- Data (6)
-
Digest
:: Base (24) -
Enumerator
:: Lazy (58) - Exception (24)
- FalseClass (24)
- Float (24)
-
Gem
:: Requirement (36) -
Gem
:: Version (12) - Hash (148)
- Integer (40)
- MatchData (24)
- Method (68)
- Module (12)
- Numeric (12)
- Object (84)
-
OpenSSL
:: BN (12) - Pathname (36)
- Prime (24)
-
Rake
:: FileList (12) - Random (12)
- Range (138)
- Rational (12)
- Regexp (36)
-
RubyVM
:: InstructionSequence (24) - Set (36)
- String (247)
- Struct (24)
- TrueClass (36)
- UnboundMethod (48)
-
WIN32OLE
_ TYPE (12)
モジュール
- Comparable (12)
- Enumerable (462)
-
Rake
:: Cloneable (12)
キーワード
- != (12)
- & (12)
- === (136)
- =~ (12)
- [] (80)
- ^ (24)
-
_ _ id _ _ (12) - allbits? (8)
- assoc (12)
-
backtrace
_ locations (12) - call (16)
-
chunk
_ while (12) - clone (36)
- count (48)
-
default
_ event _ sources (12) - delete (24)
-
delete
_ if (24) - detect (24)
- disasm (12)
- disassemble (12)
- dump (12)
- dup (12)
- each (24)
- eql? (147)
- equal? (12)
- filter (14)
- filter! (14)
- find (24)
-
find
_ all (24) -
find
_ index (36) -
has
_ value? (12) - hash (36)
- include? (37)
- intern (12)
- itself (12)
-
keep
_ if (24) - lazy (12)
-
local
_ variable _ defined? (12) - max (130)
- member? (25)
- min (130)
- minmax (12)
-
mod
_ inverse (12) - nobits? (8)
- none? (53)
- one? (53)
- pack (21)
- partition (24)
- rassoc (12)
- reject (36)
-
satisfied
_ by? (12) - select (24)
- select! (24)
- sign (12)
- slice (72)
-
slice
_ after (11) -
slice
_ before (36) -
slice
_ when (11) - sort (24)
- split (19)
- sum (12)
-
to
_ h (14) -
to
_ sym (12) - unpack (12)
- value? (12)
- | (24)
検索結果
先頭5件
-
Object
# ==(other) -> bool (21237.0) -
オブジェクトと other が等しければ真を返します。
...][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?... -
Digest
:: Base # ==(md) -> bool (21234.0) -
与えられたダイジェストオブジェクトと比較します。
...ェストオブジェクト
require 'digest/md5'
digest1 = Digest::MD5.new
digest1.update("ruby")
digest2 = Digest::MD5.new
digest2.update("ruby")
p digest1 == digest2 # => true
digest2.update("RUBY")
p digest1 == digest2 # => false... -
UnboundMethod
# ==(other) -> bool (21231.0) -
自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。
...@param other 自身と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
a = String.instance_method(:size)
b = String.instance_method(:size)
p a == b #=> true
c = Array.instance_method(:size)
p a == c #=> false
//}... -
Digest
:: Base # ==(str) -> bool (21224.0) -
与えられた文字列を hexdigest 値と見て、自身の hexdigest 値と比較します。
...られた文字列を hexdigest 値と見て、自身の hexdigest 値と比較します。
@param str 比較対象の hexdigest 文字列
require 'digest/md5'
digest = Digest::MD5.new
digest.update("ruby")
p digest == "58e53d1324eef6265fdb97b08ed9aadf" # => true... -
BasicObject
# ==(other) -> bool (21219.0) -
オブジェクトが other と等しければ真を、そうでない場合は偽を返します。
...デフォルトでは Object#equal? と同じオブジェクトの同一性になっています。
@param other 比較対象となるオブジェクト
@return other が self と同値であれば真、そうでない場合は偽
//emlist[例][ruby]{
class Person < BasicObject
def initialize(n......ame, 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?... -
CSV
:: Table # ==(other) -> bool (21219.0) -
自身の全ての行が比較対象と同じである場合は真を返します。 そうでない場合は偽を返します。
...比較対象と同じである場合は真を返します。
そうでない場合は偽を返します。
@param other CSV::Table を指定します。
//emlist[例][ruby]{
require "csv"
row1_1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row1_2 = CSV::Row.new(["header1", "header......ow1_1", "row1_2"])
row2_2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table1 = CSV::Table.new([row1_1, row1_2])
table2 = CSV::Table.new([row2_1, row2_2])
table1 == table2 # => true
table2 << CSV::Row.new(["header1", "header2"], ["row3_1", "row3_2"])
table1 == table2 # => false
//}... -
Comparable
# ==(other) -> bool (21219.0) -
比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が 0 を返した時に、true を返します。 それ以外を返した場合は、false を返します。
...ジェクト同士を比較します。
<=> が 0 を返した時に、true を返します。
それ以外を返した場合は、false を返します。
@param other 自身と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
1 == 1 # => true
1 == 2 # => false
//}... -
BigDecimal
# ==(other) -> bool (21213.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}... -
MatchData
# ==(other) -> bool (18261.0) -
self と other のマッチ対象になった文字列、元になった正規表現オブジェク ト、マッチした位置が等しければ true を返します。そうでない場合には false を返します。
...列][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...