別のキーワード
ライブラリ
- ビルトイン (256)
-
cgi
/ core (22) - continuation (11)
- csv (22)
- fiddle (11)
- matrix (44)
- nkf (11)
- openssl (11)
-
rdoc
/ context (11) -
rexml
/ document (11) -
rubygems
/ requirement (33) -
rubygems
/ version (22) - thread (2)
- zlib (11)
クラス
-
ARGF
. class (88) - Array (19)
- CGI (22)
- CSV (22)
- Exception (22)
-
Fiddle
:: Function (11) - File (22)
-
Gem
:: Requirement (33) -
Gem
:: Version (22) - Matrix (44)
-
OpenSSL
:: SSL :: Session (11) -
RDoc
:: Context :: Section (11) -
REXML
:: Instruction (11) - Rational (11)
-
RubyVM
:: InstructionSequence (44) - String (19)
-
Zlib
:: GzipReader (11)
モジュール
- Enumerable (22)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - === (11)
- =~ (11)
- ConditionVariable (11)
- Continuation (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - NKF (11)
- Requirement (11)
- Win32ネイティブ版Rubyの互換性問題 (11)
-
backtrace
_ locations (11) - disasm (22)
- disassemble (22)
- downcase (8)
- each (44)
-
each
_ line (44) - eigen (11)
- eigensystem (11)
- eql? (11)
- fiddle (11)
- header (11)
- instance (22)
- lineno= (11)
- lstat (22)
- lup (11)
-
lup
_ decomposition (11) - new (11)
- out (11)
- pack (19)
- pack テンプレート文字列 (11)
- partition (22)
- rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 8 . 5 feature (11) -
ruby 1
. 9 feature (11) -
satisfied
_ by? (11) - unpack (11)
- yaml (11)
- 制御構造 (11)
- 多言語化 (11)
検索結果
先頭5件
-
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...