9件ヒット
[1-9件を表示]
(0.071秒)
種類
- インスタンスメソッド (5)
- 特異メソッド (4)
クラス
-
Encoding
:: Converter (3) - File (1)
-
Thread
:: Backtrace :: Location (3) - TracePoint (2)
キーワード
-
absolute
_ path (1) - inspect (2)
-
to
_ s (1)
検索結果
先頭5件
-
File
. path(filename) -> String (54859.0) -
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
@param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
class MyPath
def initialize(path)
@path = path
end
def to_path
File.absolute_path(@path)
end
end
File.path("/dev/null") ... -
Encoding
:: Converter . new(convpath) -> Encoding :: Converter (54724.0) -
Encoding::Converter オブジェクトを作成します。
Encoding::Converter オブジェクトを作成します。
@param source_encoding 変換元のエンコーディング
@param destination_encoding 変換先のエンコーディング
@param options 変換の詳細を指定する定数やハッシュ
@param convpath 変換経路の配列
options では String#encode でのハッシュオプションに加えて、以下の定数が利用可能です。
* Encoding::Converter::INVALID_REPLACE
* Encoding::Converter::UNDEF_RE... -
TracePoint
# path -> String (54667.0) -
イベントが発生したファイルのパスを返します。
イベントが発生したファイルのパスを返します。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.path # => "/path/to/test.rb"
end
trace.enable
foo 1
//} -
Encoding
:: Converter . new(source _ encoding , destination _ encoding) -> Encoding :: Converter (54424.0) -
Encoding::Converter オブジェクトを作成します。
Encoding::Converter オブジェクトを作成します。
@param source_encoding 変換元のエンコーディング
@param destination_encoding 変換先のエンコーディング
@param options 変換の詳細を指定する定数やハッシュ
@param convpath 変換経路の配列
options では String#encode でのハッシュオプションに加えて、以下の定数が利用可能です。
* Encoding::Converter::INVALID_REPLACE
* Encoding::Converter::UNDEF_RE... -
Encoding
:: Converter . new(source _ encoding , destination _ encoding , options) -> Encoding :: Converter (54424.0) -
Encoding::Converter オブジェクトを作成します。
Encoding::Converter オブジェクトを作成します。
@param source_encoding 変換元のエンコーディング
@param destination_encoding 変換先のエンコーディング
@param options 変換の詳細を指定する定数やハッシュ
@param convpath 変換経路の配列
options では String#encode でのハッシュオプションに加えて、以下の定数が利用可能です。
* Encoding::Converter::INVALID_REPLACE
* Encoding::Converter::UNDEF_RE... -
Thread
:: Backtrace :: Location # absolute _ path -> String (18721.0) -
self が表すフレームの絶対パスを返します。
self が表すフレームの絶対パスを返します。
//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.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see... -
Thread
:: Backtrace :: Location # inspect -> String (400.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
Thread::Backtrace::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 do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in ... -
Thread
:: Backtrace :: Location # to _ s -> String (400.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
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... -
TracePoint
# inspect -> String (346.0) -
self の状態を人間に読みやすい文字列にして返します。
self の状態を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.inspect # "#<TracePoint:call `foo'@/path/to/test.rb:1>"
end
trace.enable
foo 1
//}