るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Set#-(enum) -> Set (21237.0)

差集合、すなわち、元の集合の要素のうち引数 enum に含まれる要素を取り除いた 新しい集合を作ります。

...す。

@
param enum each メソッドが定義されたオブジェクトを指定します。
@
raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。

//emlist[][ruby]{
require 'set'
p Set[10, 20, 30] - Set[10, 20, 40]
# => #<Set: {30}>
/...
...作ります。

@
param enum each メソッドが定義されたオブジェクトを指定します。
@
raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。

//emlist[][ruby]{
p Set[10, 20, 30] - Set[10, 20, 40]
# => #<Set: {30}>
//}...

Fiber#raise -> object (18358.0)

selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。

...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。

その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持...
...

@
param message 例外のメッセージとなる文字列です。
@
param exception 発生させる例外です。
@
param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。

//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Er...
...ror!" # => Error! (RuntimeError)
//}

//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end

p f.resume # => :loop
p f.raise StopIteration # => :exit
//}...

Fiber#raise(exception, message = nil, backtrace = nil) -> object (18358.0)

selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。

...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。

その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持...
...

@
param message 例外のメッセージとなる文字列です。
@
param exception 発生させる例外です。
@
param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。

//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Er...
...ror!" # => Error! (RuntimeError)
//}

//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end

p f.resume # => :loop
p f.raise StopIteration # => :exit
//}...

Fiber#raise(message) -> object (18358.0)

selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。

...さない場合、RuntimeError が発生します。
message 引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。

その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持...
...

@
param message 例外のメッセージとなる文字列です。
@
param exception 発生させる例外です。
@
param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。

//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Er...
...ror!" # => Error! (RuntimeError)
//}

//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end

p f.resume # => :loop
p f.raise StopIteration # => :exit
//}...

Array#-(other) -> Array (18249.0)

自身から other の要素を取り除いた配列を生成して返します。

...自身から other の要素を取り除いた配列を生成して返します。

要素の同一性は Object#eql? により評価されます。
self 中で重複していて、other中に存在していなかった要素は、その重複が保持されます。

@
param other 自身から取...
...場合は to_ary メソッドによ
る暗黙の型変換を試みます。

@
raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
[1, 2, 1, 3, 1, 4] - [4, 2] #...
...=> [1, 1, 3, 1]

[1, 2, 1, 3, 1, 4] - [1, 4] # => [2, 3]
//}...
...=> [1, 1, 3, 1]

[1, 2, 1, 3, 1, 4] - [1, 4] # => [2, 3]
//}


@
see Array#difference...

絞り込み条件を変える

TracePoint#raised_exception -> Exception (12437.0)

発生した例外を返します。

...します。

@
raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。

//emlist[例][ruby]{
t
race = TracePoint.new(:raise) do |tp|
t
p.raised_exception # => #<ZeroDivisionError: divided by 0>
end
t
race.enable
b...

TracePoint#instruction_sequence -> RubyVM::InstructionSequence (9525.0)

script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。

...pt_compiledイベント発生時にコンパイルされた
Ruby
VM::InstructionSequenceインスタンスを返します。

//emlist[例][ruby]{
T
racePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("put...
...s 'hello'")
end
//}

@
raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。...

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

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

...ption#backtraceに似ていますが、
T
hread::Backtrace::Location の配列を返す点が異なります。

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

//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Dat...
...month, -1).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_ex...
...ception'", "test.rb:15:in `<main>'"]
//}

@
see Exception#backtrace...

Exception#exception(error_message) -> Exception (9331.0)

引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。

...し Exception#message 属性を error_message にして返します。

Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。

@
param error_message エラーメッセージを表す文字列を指定します。

//emlist[例][ruby]{
begin
#...
...... # 何か処理
rescue => e
raise
e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}...

Matrix#entrywise_product(m) -> Matrix (9325.0)

アダマール積(要素ごとの積)を返します。

...ダマール積(要素ごとの積)を返します。

@
raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します。

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

Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) # => Matrix[[1, 4], [9, 8]]
//}...

絞り込み条件を変える

Gem::Installer#install -> Gem::Specification (9279.0)

Gem をインストールします。

...ルします。

@
gem_home/
cache/<gem-version>.gem #=> インストールした Gem のコピー
gems/<gem-version>/... #=> インストール時に展開したファイル
specifications/<gem-version>.gemspec #=> gemspec ファイル

@
return ロード...
...tion のインスタンスを返します。

@
raise Gem::InstallError 要求された Ruby のバージョンを満たしていない場合に発生します。

@
raise Gem::InstallError 要求された RubyGems のバージョンを満たしていない場合に発生します。

@
raise Gem::Inst...
<< 1 2 3 ... > >>