るりまサーチ

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

別のキーワード

  1. cgi element_init
  2. cgi/html element_init
  3. irb/ext/save-history init_save_history
  4. application init
  5. inspector init

ライブラリ

クラス

キーワード

検索結果

MiniTest::Unit#location(exception) -> String (21101.0)

与えられた例外の発生した場所を返します。

与えられた例外の発生した場所を返します。

Thread::Backtrace::Location (6018.0)

Ruby のフレームを表すクラスです。

...er_locations から生成されます。

//emlist[例1][ruby]{
# caller_locations.rb
def a(skip)
caller_locations(skip)
end
def b(skip)
a(skip)
end
def c(skip)
b(skip)
end

c(0..2).map do |call|
puts call.to_s
end
//}

例1の実行結果:

caller_locations.rb:2:in `a'
caller_locations....
...caller_locations.rb:8:in `c'

//emlist[例2][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.to_s
end
//}

例2の実行結果:

init
.rb:4:in `initialize'
init
.rb:8:i...

NEWS for Ruby 2.5.0 (12.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...13780
* String#undump を追加。String#dumpで出力した文字列を元に戻します。12275

* Struct
* Struct.new は :keyword_init というキーワード引数を受け取り、メンバーをキーワード引数で初期化できるようになりました。
11925...
...safe_load like JSON.parse
https://github.com/ruby/psych/pull/333, https://github.com/ruby/psych/pull/337
* Add Psych::Handler#event_location
https://github.com/ruby/psych/pull/326
* Make frozen string literal = true
https://github.com/ruby/psych/pull/320
* P...
...zlib

* Logger
* Logger.new("| command") は意図せず、コマンドを実行していましたが、禁止されました。
Logger#initialize の引数は仕様としてファイル名としてのみ扱うようになりました。
14212

* Net::HTTP
* Net::HTTP#start...