るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. _builtin at
  2. _builtin values_at
  3. time at
  4. dbm values_at
  5. csv values_at

検索結果

Logger::Formatter#call(severity, time, progname, msg) -> String (63307.0)

ログ情報をフォーマットして返します。

ログ情報をフォーマットして返します。

@param severity ログレベル。

@param time 時間。Time クラスのオブジェクト。

@param progname プログラム名

@param msg メッセージ。

Syslog::Logger::Formatter#call(severity, time, progname, message) -> String (63307.0)

引数を元にフォーマットした文字列を返します。

引数を元にフォーマットした文字列を返します。

ライブラリ内部で使用します。

Continuation#call(*ret) -> () (54307.0)

self が記憶した状態を継続します。引数は そのまま Kernel.#callcc の戻り値になります。

self が記憶した状態を継続します。引数は そのまま
Kernel.#callcc の戻り値になります。

@param ret 継続に復帰した時に返す値を指定します。

NoMethodError#private_call? -> bool (36607.0)

メソッド呼び出しが private なメソッドを呼び出せる形式 (関数形式(レシーバを省略した形式)) で呼ばれたかどうかを返します。

メソッド呼び出しが private なメソッドを呼び出せる形式
(関数形式(レシーバを省略した形式)) で呼ばれたかどうかを返します。

Thread::Backtrace::Location#absolute_path -> String (27340.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...

絞り込み条件を変える

Syslog::Logger#formatter=(formatter) (18658.0)

ログを出力する際に使用するフォーマッターをセットします。

ログを出力する際に使用するフォーマッターをセットします。

@param formatter 4 つの引数 (severity, time, program name, message) を
受け取る call メソッドを 持つオブジェクトを指定します。

引数 formatter が持つ call メソッドは以下の 4 つの引数 (severity,
time, program name, message) を受けとります。

: severity

このメッセージのログレベル(Logger::Severity 参照)。

: time

このメッ...

Logger#formatter=(formatter) (18640.0)

ログを出力する際に使用するフォーマッターをセットします。

ログを出力する際に使用するフォーマッターをセットします。

@param formatter 4 つの引数 (severity, time, program name, message) を受け取る call メソッドを
持つオブジェクトを指定します。call メソッドの返り値は文字列にしてください。

//emlist[][ruby]{
require 'logger'
logger = Logger.new
logger.formatter = proc{|severity, datetime, progname, message|
"#{datet...

Logger#formatter -> String (18322.0)

ログを出力する際に使用するフォーマッターを取得します。

ログを出力する際に使用するフォーマッターを取得します。

このメソッドの返り値が持つ call メソッドは 4 つの引数 (severity, time, program name, message) を受けとります。

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

logger = Logger.new(STDOUT)
logger.formatter # => nil
logger.info("test")
# => I, [2019-05-09T22:13:56.509159 #13912] INFO -- : test

ltsv_formatter =...

TracePoint#path -> String (18322.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
//}

Thread::Backtrace::Location#base_label -> String (9040.0)

self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。

self が表すフレームの基本ラベルを返します。通常、
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.base_label
end

# => init...

絞り込み条件を変える

Thread::Backtrace::Location#inspect -> String (9040.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 (9040.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...

Continuation#[](*ret) -> () (9007.0)

self が記憶した状態を継続します。引数は そのまま Kernel.#callcc の戻り値になります。

self が記憶した状態を継続します。引数は そのまま
Kernel.#callcc の戻り値になります。

@param ret 継続に復帰した時に返す値を指定します。

Enumerable#detect(ifnone = nil) -> Enumerator (340.0)

要素に対してブロックを評価した値が真になった最初の要素を返します。

要素に対してブロックを評価した値が真になった最初の要素を返します。

真になる要素が見つからず、ifnone も指定されていないときは nil を返します。
真になる要素が見つからず、ifnone が指定されているときは ifnone を call した結果を返します。

ブロックを省略した場合は Enumerator を返します。

@param ifnone call メソッドを持つオブジェクト (例えば Proc) を指定します。

//emlist[例][ruby]{
# 最初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } ...

Enumerable#find(ifnone = nil) -> Enumerator (340.0)

要素に対してブロックを評価した値が真になった最初の要素を返します。

要素に対してブロックを評価した値が真になった最初の要素を返します。

真になる要素が見つからず、ifnone も指定されていないときは nil を返します。
真になる要素が見つからず、ifnone が指定されているときは ifnone を call した結果を返します。

ブロックを省略した場合は Enumerator を返します。

@param ifnone call メソッドを持つオブジェクト (例えば Proc) を指定します。

//emlist[例][ruby]{
# 最初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } ...

絞り込み条件を変える

Thread#report_on_exception=(newstate) (322.0)

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

デフォルトはスレッド作成時の Thread.report_on_exception です。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。

//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Th...

Module#ruby2_keywords(method_name, ...) -> nil (118.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument...

Proc#ruby2_keywords -> proc (118.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked ...