るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n=
  3. rsa n
  4. openssl n=
  5. openssl n

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Exception#==(other) -> bool (21135.0)

自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。

...自身と指定された other のクラスが同じであり、
message と backtrace が == メソッドで比較して
等しい場合に true を返します。そうでない場合に false を返します。

@param other 自身と比較したいオブジェクトを指定します。...
...Exception#exception を実行して変換を試みます。

//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...
...eption { check_long_month(e) } }
p results.map { |e| e.class }
# => [RuntimeError, RuntimeError, RuntimeError]
p results.map { |e| e.message }
# => ["2 is not long month", "2 is not long month", "4 is not long month"]

# class, message, backtrace が同一のため true になる
p results[0] == res...

Range#==(other) -> bool (21135.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
//}...

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

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

...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 (21125.0)

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

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

other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false...
...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" == stringlik...
...e #=> true
//}

@see String#eql?...

Pathname#==(other) -> bool (21119.0)

パス名を比較し、 other と同じなら真を返します。大文字小文字は区別されます。 other は Pathname オブジェクトでなければなりません。

...other は Pathname オブジェクトでなければなりません。

パス名の比較は単純にパス文字列の比較によって行われるので、論理的に
同じパスでもパス文字列が違えば異なると判断されます。

@param other 比較対象の Pathname オブジ...
...ェクトを指定します。

//emlist[例][ruby]{
require 'pathname'

p Pathname.new("foo/bar") == Pathname.new("foo/bar")
p Pathname.new("foo/bar") == Pathname.new("foo//bar")
p Pathname.new("foo/../foo/bar") == Pathname.new("foo/bar")

# => true
# false
# false
//}...

絞り込み条件を変える

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

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

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

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


//emlist[例][ruby]{
r1 = Random.new(1)
r2 = Random.new(1)

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

Fiddle::Pointer#==(other) -> bool (21113.0)

ポインタの指すアドレスが同一ならばtrueを返します。

...タの指すアドレスが同一ならばtrueを返します。

@param other 比較対象の Pointer オブジェクト

例:

require 'fiddle'

s = 'abc'
cptr = Fiddle::Pointer[s]
cptr0 = Fiddle::Pointer[s]
cptr1 = cptr + 1

p cptr == cptr1 #=> false
p cptr == cptr0 #=> true...

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

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

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

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

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

UnboundMethod#==(other) -> bool (21113.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
//}...

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

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

...す。URI は正規化して比較されます。

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

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

絞り込み条件を変える

<< 1 2 3 ... > >>