ライブラリ
- ビルトイン (2450)
- base64 (11)
-
cgi
/ core (22) - coverage (6)
- csv (77)
- date (11)
- delegate (11)
- digest (22)
- fiddle (33)
- find (22)
- gdbm (11)
- ipaddr (33)
- matrix (121)
- nkf (11)
- objspace (11)
- openssl (99)
- ostruct (11)
- pathname (44)
- prime (22)
- rake (22)
-
rdoc
/ context (11) - readline (11)
-
rexml
/ document (22) -
rinda
/ rinda (11) -
rubygems
/ package / tar _ header (11) -
rubygems
/ platform (22) -
rubygems
/ requirement (33) - set (32)
- thread (2)
- uri (11)
-
webrick
/ httpauth (11) - win32ole (22)
- zlib (11)
クラス
-
ARGF
. class (88) - Array (383)
- BasicObject (44)
- Bignum (9)
- Binding (11)
- CGI (22)
- CSV (22)
-
CSV
:: Row (22) -
CSV
:: Table (33) - Complex (11)
- Coverage (6)
- Data (8)
- Date (11)
- Delegator (11)
-
Digest
:: Base (22) - Enumerator (23)
-
Enumerator
:: ArithmeticSequence (6) -
Enumerator
:: Lazy (107) - Exception (22)
- FalseClass (33)
-
Fiddle
:: Function (11) -
Fiddle
:: Pointer (22) - File (22)
- Fixnum (3)
- Float (33)
- GDBM (11)
-
Gem
:: Package :: TarHeader (11) -
Gem
:: Platform (22) -
Gem
:: Requirement (33) - Hash (156)
- IPAddr (33)
- Integer (43)
- KeyError (7)
- MatchData (22)
- Matrix (99)
- Method (50)
- Module (11)
- Numeric (66)
- Object (66)
-
OpenSSL
:: BN (55) -
OpenSSL
:: PKey :: EC :: Group (22) -
OpenSSL
:: PKey :: EC :: Point (22) - OpenStruct (11)
- Pathname (44)
- Prime (22)
- Proc (44)
-
Process
:: Status (11) -
RDoc
:: Context :: Section (11) -
REXML
:: Instruction (11) -
REXML
:: XMLDecl (11) -
Rake
:: FileList (22) - Random (22)
- Range (116)
- Rational (11)
- Regexp (33)
-
Rinda
:: DRbObjectTemplate (11) -
RubyVM
:: InstructionSequence (44) - Set (32)
- String (288)
- Struct (22)
- Symbol (33)
- SystemCallError (11)
- Thread (11)
- Time (22)
- TrueClass (33)
-
URI
:: Generic (11) - UnboundMethod (22)
- Vector (22)
- WIN32OLE (11)
-
WIN32OLE
_ TYPE (11) -
Zlib
:: GzipReader (11)
モジュール
- Base64 (11)
- Comparable (11)
- Enumerable (384)
- Find (22)
- GC (22)
- Math (22)
- ObjectSpace (11)
- Process (11)
-
Process
:: GID (22) -
Process
:: UID (22) - Readline (11)
-
WEBrick
:: HTTPAuth (11)
キーワード
- != (11)
- % (11)
- & (22)
- +@ (9)
- -@ (9)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - === (193)
- =~ (11)
- ConditionVariable (11)
- Marshal フォーマット (11)
-
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - NKF (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
- [] (95)
- ^ (22)
-
_ _ id _ _ (11) - acos (11)
- allbits? (7)
- asin (11)
- assoc (22)
-
backtrace
_ locations (11) -
basic
_ auth (11) - call (25)
- chunk (22)
-
chunk
_ while (11) - clone (11)
- collect (11)
- count (66)
- crypt (11)
- dedup (2)
-
default
_ event _ sources (11) - define (4)
- delete (22)
-
delete
_ if (55) - detect (22)
- disasm (22)
- disassemble (22)
- div (11)
- divmod (22)
- downcase (8)
- dump (7)
- dup (11)
- each (66)
-
each
_ line (44) - eigen (11)
- eigensystem (11)
- empty (11)
- encode64 (11)
- eql? (181)
- equal? (11)
- filter (12)
- filter! (12)
- find (44)
-
find
_ all (22) -
find
_ index (66) -
generate
_ prime (11) - getlocal (22)
- getrlimit (11)
-
has
_ value? (11) - hash (22)
- header (11)
- id2name (11)
- include? (45)
- index (33)
- instance (22)
- join (11)
-
keep
_ if (22) - key (7)
-
latest
_ gc _ info (22) - lazy (11)
-
line
_ stub (6) - lineno= (11)
-
local
_ variable _ defined? (11) - lstat (22)
- lup (11)
-
lup
_ decomposition (11) - map (11)
-
marshal
_ load (11) - max (118)
- member? (23)
-
memsize
_ of _ all (11) - min (118)
-
mod
_ inverse (11) - modulo (11)
-
net
/ http (11) - new (57)
- nobits? (7)
- none? (39)
-
ole
_ func _ methods (11) - one? (39)
- out (11)
- pack (19)
- pack テンプレート文字列 (11)
-
pending
_ interrupt? (11) - produce (5)
- rassoc (22)
- readline (11)
- rect (11)
- rectangular (11)
- reject (44)
- reject! (22)
- remainder (11)
- rindex (33)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
satisfied
_ by? (11) - select (33)
- select! (22)
- slice (66)
-
slice
_ after (20) -
slice
_ before (33) -
slice
_ when (10) - sort (22)
- split (17)
- sqrt (7)
- sum (11)
- switch (44)
-
to
_ h (12) -
to
_ hash (11) -
to
_ s (11) - tsort (11)
-
unicode
_ normalize! (10) - unpack (11)
- value? (11)
- yaml (11)
- yield (11)
- | (22)
- クラス/メソッドの定義 (11)
- 多言語化 (11)
- 演算子式 (11)
検索結果
先頭5件
-
Hash
# ==(other) -> bool (18158.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?... -
Array
# ==(other) -> bool (18146.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
//}... -
BasicObject
# ==(other) -> bool (18142.0) -
オブジェクトが other と等しければ真を、さもなくば偽を返します。
...トの同一性になっています。
@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?... -
Float
# ==(other) -> bool (18142.0) -
比較演算子。数値として等しいか判定します。
...して等しいか判定します。
@param 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
//}... -
MatchData
# ==(other) -> bool (18142.0) -
self と other のマッチ対象になった文字列、元になった正規表現オブジェク ト、マッチした位置が等しければ true を返します。そうでない場合には false を返します。
...。そうでない場合には
false を返します。
@param other 比較対象のオブジェクトを指定します。
//emlist[文字列][ruby]{
s = "abc"
m1 = s.match("a")
m2 = s.match("b")
m1 == m2 # => false
m2 = s.match("a")
m1 == m2 # => true
//}
//emlist[正規表現][ruby]{
r = /ab......#<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
//}... -
Rational
# ==(other) -> bool (18142.0) -
数値として等しいか判定します。
...判定します。
@param 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 (18142.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
... == 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
raise
end
p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> true
//}
@see String#eql?... -
Data
# ==(other) -> bool (18140.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?... -
Exception
# ==(other) -> bool (18140.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 (18140.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
//}...