ライブラリ
- ビルトイン (223)
-
minitest
/ unit (1) - objspace (60)
-
rdoc
/ context (12)
クラス
- Binding (7)
- Exception (12)
- Method (24)
-
MiniTest
:: Unit (1) - Module (12)
- Proc (12)
-
RDoc
:: Context (12) - Thread (24)
-
Thread
:: Backtrace :: Location (84) - UnboundMethod (12)
モジュール
- Kernel (24)
- ObjectSpace (60)
キーワード
- Location (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
absolute
_ path (12) -
allocation
_ sourcefile (12) -
allocation
_ sourceline (12) -
backtrace
_ locations (36) -
base
_ label (12) -
caller
_ locations (24) -
const
_ source _ location (12) - inspect (18)
- label (12)
- lineno (12)
-
mark
_ locations _ array (12) -
net
/ http (12) - path (12)
-
rb
_ gc _ mark _ locations (12) -
record
_ location (12) -
rubygems
/ security (12) -
source
_ location (43) -
to
_ s (18) -
trace
_ object _ allocations (12) -
trace
_ object _ allocations _ start (12) -
trace
_ object _ allocations _ stop (12)
検索結果
先頭5件
-
void rb
_ gc _ mark _ locations(VALUE *start , VALUE *end) (6100.0) -
-
Thread
:: Backtrace :: Location (6000.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.......rb:5:in `b'
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'... -
Thread
:: Backtrace :: Location # base _ label -> String (3022.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
...通常、
Thread::Backtrace::Location#label から修飾を取り除いたもので構成
されます。
//emlist[例][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.ba......se_label
end
# => initialize
# new
# <main>
//}
@see Thread::Backtrace::Location#label... -
Thread
:: Backtrace :: Location # inspect -> String (3016.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...ktrace::Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map d... -
Thread
:: Backtrace :: Location # label -> String (3012.0) -
self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ ジュール名などで構成されます。
...フレームのラベルを返します。通常、メソッド名、クラス名、モ
ジュール名などで構成されます。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.label # => "a"
//}
@see Thread::Backtrace::Location#base_label... -
Thread
:: Backtrace :: Location # path -> String (3012.0) -
self が表すフレームのファイル名を返します。
...self が表すフレームのファイル名を返します。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}
@see Thread::Backtrace::Location#absolute_path... -
Thread
:: Backtrace :: Location # absolute _ path -> String (3006.0) -
self が表すフレームの絶対パスを返します。
...][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.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see Thread::Backtrace::Location#path... -
Thread
:: Backtrace :: Location # lineno -> Integer (3006.0) -
self が表すフレームの行番号を返します。
...self が表すフレームの行番号を返します。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.lineno # => 2
//}... -
Thread
:: Backtrace :: Location # to _ s -> String (3000.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...にした文字列を返し
ます。
//emlist[例][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
# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in...