種類
ライブラリ
- English (12)
- ビルトイン (3132)
- base64 (12)
- bigdecimal (48)
-
cgi
/ core (24) - continuation (12)
- coverage (7)
- csv (84)
- date (12)
- dbm (12)
- delegate (12)
- digest (24)
- drb (24)
- fiddle (36)
- find (24)
- gdbm (12)
- ipaddr (36)
- matrix (132)
-
net
/ ftp (10) - nkf (12)
- objspace (12)
- openssl (144)
- ostruct (12)
- pathname (48)
- prime (24)
- rake (36)
-
rdoc
/ context (12) - readline (12)
-
rexml
/ document (60) -
rinda
/ rinda (12) -
rubygems
/ package / tar _ header (12) -
rubygems
/ platform (24) -
rubygems
/ requirement (48) -
rubygems
/ version (24) - sdbm (36)
- set (42)
- socket (84)
- strscan (12)
- thread (2)
- uri (12)
-
webrick
/ httpauth (12) -
webrick
/ httpauth / htdigest (12) -
webrick
/ httpauth / htpasswd (12) - win32ole (24)
- zlib (12)
クラス
-
ARGF
. class (96) - Addrinfo (48)
- Array (423)
- BasicObject (48)
- BasicSocket (12)
- BigDecimal (48)
- Bignum (9)
- Binding (12)
- CGI (24)
- CSV (24)
-
CSV
:: Row (24) -
CSV
:: Table (36) - Complex (12)
- Coverage (7)
- DBM (12)
-
DRb
:: DRbObject (24) - Data (12)
- Date (12)
- Delegator (12)
-
Digest
:: Base (24) - Enumerator (25)
-
Enumerator
:: ArithmeticSequence (7) -
Enumerator
:: Lazy (129) - Exception (24)
- FalseClass (36)
-
Fiddle
:: Function (12) -
Fiddle
:: Pointer (24) - File (24)
- Fixnum (3)
- Float (36)
- GDBM (12)
-
Gem
:: Package :: TarHeader (12) -
Gem
:: Platform (24) -
Gem
:: Requirement (48) -
Gem
:: Version (24) - Hash (177)
- IPAddr (36)
- Integer (48)
- KeyError (8)
- MatchData (24)
- Matrix (108)
- Method (68)
- Module (12)
-
Net
:: FTP :: MLSxEntry (10) - Numeric (72)
- Object (84)
-
OpenSSL
:: BN (60) -
OpenSSL
:: PKey :: EC :: Group (24) -
OpenSSL
:: PKey :: EC :: Point (24) -
OpenSSL
:: SSL :: Session (12) - OpenStruct (12)
- Pathname (48)
- Prime (24)
- Proc (60)
-
Process
:: Status (12) -
RDoc
:: Context :: Section (12) -
REXML
:: Attribute (12) -
REXML
:: Comment (12) -
REXML
:: Element (12) -
REXML
:: Instruction (12) -
REXML
:: XMLDecl (12) -
Rake
:: FileList (24) - Random (38)
- Range (138)
- Rational (12)
- Regexp (36)
-
Rinda
:: DRbObjectTemplate (12) -
RubyVM
:: InstructionSequence (48) - SDBM (36)
- Set (60)
- Socket (12)
- String (345)
- StringScanner (12)
- Struct (24)
- Symbol (36)
- SystemCallError (12)
- Thread (24)
- Time (48)
- TrueClass (36)
-
URI
:: Generic (12) - UnboundMethod (48)
- Vector (24)
- WIN32OLE (12)
-
WIN32OLE
_ TYPE (12) -
Zlib
:: GzipReader (12)
モジュール
- Base64 (12)
- Comparable (12)
- Enumerable (462)
- Find (24)
- GC (24)
- Kernel (12)
- Math (24)
- ObjectSpace (12)
- Process (12)
-
Process
:: GID (24) -
Process
:: UID (24) -
Rake
:: Cloneable (12) - Readline (12)
-
WEBrick
:: HTTPAuth (12)
オブジェクト
- ENV (144)
キーワード
- != (12)
-
$ CHILD _ STATUS (12) - % (12)
- & (24)
- +@ (10)
- -@ (10)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - === (223)
- =~ (12)
- ConditionVariable (12)
- Continuation (12)
- DEFAULT (2)
- DH (12)
- GID (12)
- Htdigest (12)
- Htpasswd (12)
- Lazy (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - NKF (12)
- Numeric (12)
- OCSP (12)
- OPS (12)
- Requirement (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Ruby用語集 (12)
- String (12)
- Symbol (12)
- TCPServer (12)
- UID (12)
- Win32ネイティブ版Rubyの互換性問題 (12)
- [] (104)
- ^ (24)
-
_ _ id _ _ (12) - acos (12)
- afamily (12)
- allbits? (8)
- asin (12)
- assoc (24)
-
backtrace
_ locations (12) -
basic
_ auth (12) - bigdecimal (12)
- call (28)
- chunk (24)
-
chunk
_ while (12) - clone (36)
- collect (12)
- count (72)
- coverage (12)
- crypt (12)
- dedup (3)
-
default
_ event _ sources (12) - define (6)
- delete (24)
-
delete
_ if (96) - detect (24)
- disasm (24)
- disassemble (24)
- div (12)
- divide (24)
- divmod (24)
- downcase (9)
- dump (12)
- dup (12)
- each (96)
-
each
_ key (24) -
each
_ line (48) -
each
_ pair (24) - eigen (12)
- eigensystem (12)
- empty (12)
- encode64 (12)
- eql? (234)
- equal? (12)
- fiddle (12)
-
fiddle
/ types (12) - file? (10)
- filter (14)
- filter! (14)
- find (48)
-
find
_ all (24) -
find
_ index (72) -
generate
_ prime (12) - getgm (12)
- getifaddrs (12)
- getlocal (24)
- getpeername (12)
- getrlimit (12)
- getutc (12)
- group (12)
-
has
_ value? (12) - hash (48)
- header (12)
- id2name (12)
- include? (49)
- index (36)
- instance (24)
- intern (12)
- itself (12)
- join (12)
-
keep
_ if (24) - key (8)
-
latest
_ gc _ info (24) - lazy (24)
-
line
_ stub (7) - lineno= (12)
-
local
_ variable _ defined? (12) - lstat (24)
- lup (12)
-
lup
_ decomposition (12) - map (12)
-
marshal
_ dump (12) -
marshal
_ load (12) - max (130)
- member? (25)
-
memsize
_ of _ all (12) - min (130)
- minmax (12)
-
mod
_ inverse (12) - modulo (12)
-
net
/ http (12) -
net
/ pop (12) - new (62)
- nobits? (8)
- none? (53)
-
ole
_ func _ methods (12) - one? (53)
- out (12)
- pack (21)
- pack テンプレート文字列 (12)
- partition (24)
-
pending
_ interrupt? (12) - pfamily (12)
- produce (6)
- protocol (12)
- rassoc (24)
-
rb
_ equal (12) -
rb
_ f _ require (12) - rdoc (12)
- readline (12)
- rect (12)
- rectangular (12)
- reject (72)
- reject! (60)
- remainder (12)
-
rinda
/ rinda (12) - rindex (36)
-
root
_ node (12) - rss (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 8 . 5 feature (12) -
ruby 1
. 9 feature (12) -
satisfied
_ by? (12) - select (60)
- select! (24)
- sign (12)
- slice (72)
-
slice
_ after (22) -
slice
_ before (36) -
slice
_ when (11) - socktype (12)
- sort (24)
- split (19)
- sqrt (8)
- string (12)
- sum (12)
- switch (48)
-
to
_ h (19) -
to
_ hash (12) -
to
_ proc (12) -
to
_ s (12) -
to
_ sym (12) - tracer (12)
- tsort (12)
-
unicode
_ normalize! (11) - unpack (12)
- value? (12)
-
webrick
/ cgi (12) - yaml (12)
- yield (12)
- | (24)
- クラス/メソッドの定義 (12)
- パターンマッチ (12)
- 制御構造 (12)
- 多言語化 (12)
- 演算子式 (12)
検索結果
先頭5件
-
Hash
# ==(other) -> bool (18146.0) -
自身と other が同じ数のキーを保持し、キーが eql? メソッドで比較して全て等しく、 値が == メソッドで比較して全て等しい場合に真を返します。
...く、
値が == メソッドで比較して全て等しい場合に真を返します。
@param other 自身と比較したい Hash オブジェクトを指定します。
//emlist[例][ruby]{
#(出力関数は省略)
{ 1 => :a } == { 1 => :a } #=> true
{ 1 => :a } == { 1 => :a, 2 =......> :b } #=> false
{ 1 => :a } == { 1.0 => :a } #=> false ( 1.eql?(1.0) は false なので)
{ :x => 1 } == { :x => 1.0 } #=> true ( 1 == 1.0 は true なので)
//}
@see Hash#equal?... -
MatchData
# ==(other) -> bool (18136.0) -
self と other のマッチ対象になった文字列、元になった正規表現オブジェク ト、マッチした位置が等しければ true を返します。そうでない場合には false を返します。
...= 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
//}... -
Array
# ==(other) -> bool (18134.0) -
自身と other の各要素をそれぞれ順に == で比較し て、全要素が等しければ true を返します。そうでない場合には false を返します。
... == で比較し
て、全要素が等しければ 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
//}... -
Exception
# ==(other) -> bool (18134.0) -
自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。
...自身と指定された other のクラスが同じであり、
message と backtrace が == メソッドで比較して
等しい場合に true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。......on を実行して変換を試みます。
//emlist[例][ruby]{
require "date"
def check_long_month(month)
return if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
results = [2, 2, 4].map { |e......is not long month", "2 is not long month", "4 is not long month"]
# class, message, backtrace が同一のため true になる
p results[0] == results[1] # => true
# class, backtrace が同一だが、message がことなるため false になる
p results[0] == results[2] # => false
//}... -
Range
# ==(other) -> bool (18134.0) -
指定された other が Range クラスのインスタンスであり、 始端と終端が == メソッドで比較して等しく、Range#exclude_end? が同じ場合に true を返します。そうでない場合に false を返します。
...始端と終端が == メソッドで比較して等しく、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
//}... -
Float
# ==(other) -> bool (18130.0) -
比較演算子。数値として等しいか判定します。
...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 (18130.0) -
数値として等しいか判定します。
...なければ 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
//}......でなければ 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
//}... -
Data
# ==(other) -> bool (18128.0) -
self と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。
...self と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。
@param other self と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
Dog = Data.def......ine(:name, :age)
dog1 = Dog.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?... -
Object
# ==(other) -> bool (18124.0) -
オブジェクトと other が等しければ真を返します。
...の例のように、各クラスの性質に合わせて再定義されることが期待されています。
//emlist[適切に再定義されている例][ruby]{
p("foo" == "bar") #=> false
p("foo" == "foo") #=> true
p(4 == 4) #=> true
p(4 == 4.0) #=> true
//}
@see Object#equal?,Object#eql?... -
Regexp
# ==(other) -> bool (18124.0) -
otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。
...ら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
//}...