るりまサーチ

最速Rubyリファレンスマニュアル検索!
706件ヒット [1-100件を表示] (0.052秒)
トップページ > クエリ:IO[x] > クエリ:io[x] > クエリ:==[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io readlines
  5. io each_line

ライブラリ

モジュール

検索結果

<< 1 2 3 ... > >>

Exception#==(other) -> bool (24134.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 =...
...ception { 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] == re...

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

OpenSSL::SSL::Session#==(other) -> bool (24100.0)

otherと自身が同一のセッションであれば真を返します。

otherと自身が同一のセッションであれば真を返します。

RDoc::Context::Section#==(other) -> bool (24100.0)

自身と other のシーケンス番号を比較した結果を返します。

...自身と other のシーケンス番号を比較した結果を返します。

@param other RDoc::Context::Section オブジェクトを指定します。...

REXML::Instruction#==(other) -> bool (24100.0)

other と self が同じ 処理命令である場合に真を返します。

...other と self が同じ 処理命令である場合に真を返します。

同じとは、 REXML::Instruction#target と REXML::Instruction#content
が一致することを意味します。

@param other 比較対象...

絞り込み条件を変える

Exception#backtrace_locations -> [Thread::Backtrace::Location] (18406.0)

バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。

...バックトレース情報を返します。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。

現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。

//emlist[例: test.rb][ruby]{
require...
....day == 31
raise "#{month} is not long month"
end

def get_exception
return begin
yield
rescue => e
e
end
end

e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'",...
..."test.rb:15:in `<main>'"]
//}

@see Exception#backtrace...

Gem::Requirement#===(version) -> bool (12400.0)

引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。 そうでなければ、false を返します。

...引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。
そうでなければ、false を返します。

@param version Gem::Version のインスタンスを指定します。

//emlist[][ruby]{
req = Gem::Requirement.new("~> 3.2.1")

p req.satisfi...
...ed_by?(Gem::Version.new('3.2.9')) # => true
p req.satisfied_by?(Gem::Version.new('3.3.0')) # => false
//}...

Enumerable#partition -> Enumerator (12206.0)

各要素を、ブロックの条件を満たす要素と満たさない要素に分割します。 各要素に対してブロックを評価して、その値が真であった要素の配列と、 偽であった要素の配列の 2 つを配列に入れて返します。

...要素の配列と、
偽であった要素の配列の 2 つを配列に入れて返します。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0].partition {|i| i % 3 == 0 }
#=> [[9, 6, 3, 0], [10, 8, 7, 5, 4, 2, 1]]
//}...

Enumerable#partition {|item| ... } -> [[object], [object]] (12206.0)

各要素を、ブロックの条件を満たす要素と満たさない要素に分割します。 各要素に対してブロックを評価して、その値が真であった要素の配列と、 偽であった要素の配列の 2 つを配列に入れて返します。

...要素の配列と、
偽であった要素の配列の 2 つを配列に入れて返します。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0].partition {|i| i % 3 == 0 }
#=> [[9, 6, 3, 0], [10, 8, 7, 5, 4, 2, 1]]
//}...

Thread::ConditionVariable (12030.0)

スレッドの同期機構の一つである状態変数を実現するクラスです。

...の一つである状態変数を実現するクラスです。

以下も ConditionVariable を理解するのに参考になります。

https://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF

==
= Condition Variable とは

あるスレッド A が排他領域で動いていたとし...
...リソースの空きを
待っていても、いつまでも空くことはありません。

以上のような状況を解決するのが Condition Variable です。

スレッド a で条件(リソースが空いているかなど)が満たされるまで wait メソッドで
スレッドを...
...ッド a に対して条件が成立したことを通知します。これが典型的な
使用例です。

mutex = Mutex.new
cv = ConditionVariable.new

a = Thread.start {
mutex.synchronize {
...
while (条件が満たされない)
cv.wait(mute...

絞り込み条件を変える

<< 1 2 3 ... > >>