るりまサーチ (Ruby 3.0)

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

別のキーワード

  1. psych psych_y
  2. kernel y
  3. psych y
  4. kernel psych_y
  5. y syck

検索結果

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

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

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

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

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

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

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

@param severity ログレベル。

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

@param progname プログラム名

@param msg メッセージ。

Net::HTTP#verify_callback -> Proc (36604.0)

自身に設定されている検証をフィルタするコールバックを 返します。

自身に設定されている検証をフィルタするコールバックを
返します。

デフォルトのコールバックが設定されている場合には nil を返します。

@see Net::HTTP#verify_callback=,
OpenSSL::X509::Store#verify_callback,
OpenSSL::SSL::SSLContext#verify_callback

Net::HTTP#verify_callback=(proc) (36604.0)

検証をフィルタするコールバックを設定します。

検証をフィルタするコールバックを設定します。

詳しくは OpenSSL::X509::Store#verify_callback= や
OpenSSL::SSL::SSLContext#verify_callback= を見てください。

@param proc 設定する Proc オブジェクト
@see Net::HTTP#verify_callback,
OpenSSL::X509::Store#verify_callback=,
OpenSSL::SSL::SSLContext#verify_callback=

OpenSSL::SSL::SSLContext#verify_callback -> Proc | nil (36604.0)

オブジェクトに設定されている検証をフィルタするコールバックを 返します。

オブジェクトに設定されている検証をフィルタするコールバックを
返します。

デフォルトのコールバックが設定されている場合には nil を返します。

@see OpenSSL::X509::Store#verify_callback,
OpenSSL::SSL::SSLContext#verify_callback=

絞り込み条件を変える

OpenSSL::SSL::SSLContext#verify_callback=(proc) (36604.0)

検証をフィルタするコールバックを設定します。

検証をフィルタするコールバックを設定します。

OpenSSL::X509::Store#verify_callback= と同じ働きをします。

コールバックには Proc や Method を渡します。

渡されたコールバックオブジェクトは証明書チェインの検証時に
チェインに含まれる各証明書の署名を検証するたびに呼びだされます。
そのときに渡される引数は2つで、1つめは検証が成功したかの真偽値、
2つめは検証後の状態を保存した
OpenSSL::X509::StoreContext オブジェクトです。
このコールバックには2つの役割があります。1つ目はコンテキストオブジェクト
を調べること...

OpenSSL::X509::Store#verify_callback -> Proc | nil (36604.0)

オブジェクトに設定されている検証をフィルタするコールバックを 返します。

オブジェクトに設定されている検証をフィルタするコールバックを
返します。

デフォルトのコールバックが設定されている場合には nil を返します。

@see OpenSSL::X509::Store#verify_callback=

OpenSSL::X509::Store#verify_callback=(proc) (36604.0)

検証をフィルタするコールバックを設定します。

検証をフィルタするコールバックを設定します。

コールバックには Proc や Method を渡します。

渡されたコールバックオブジェクトは証明書チェインの検証時に
チェインに含まれる各証明書の署名を検証するたびに呼びだされます。
そのときに渡される引数は以下のように
proc{|ok, ctx| ... }
2つで、1つめは検証が成功したかの真偽値、
2つめは検証後の状態を保存した
OpenSSL::X509::StoreContext オブジェクトです。
このコールバックには2つの役割があります。1つ目はコンテキストオブジェクト
を調べることで詳細なエラー情報を得ることです。2つ目...

TracePoint#callee_id -> Symbol | nil (18622.0)

イベントが発生したメソッドの呼ばれた名前を Symbol で返します。 トップレベルであった場合は nil を返します。

イベントが発生したメソッドの呼ばれた名前を Symbol で返します。
トップレベルであった場合は nil を返します。

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

//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end

trace = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_id] # => [:method_name, :alias_name]
e...

Method#curry -> Proc (18430.0)

self を元にカリー化した Proc を返します。

self を元にカリー化した Proc を返します。

カリー化した Proc はいくつかの引数をとります。十分な数の引数が与
えられると、元の Proc に引数を渡し て実行し、結果を返します。引数
の個数が足りないときは、部分適用したカリー化 Proc を返します。

@param arity 引数の個数を指定します。可変長の引数を指定できるメソッドを
カリー化する際には必ず指定する必要があります。

//emlist[例][ruby]{
def foo(a,b,c)
[a, b, c]
end

proc = self.method(:foo).curr...

絞り込み条件を変える

Method#curry(arity) -> Proc (18430.0)

self を元にカリー化した Proc を返します。

self を元にカリー化した Proc を返します。

カリー化した Proc はいくつかの引数をとります。十分な数の引数が与
えられると、元の Proc に引数を渡し て実行し、結果を返します。引数
の個数が足りないときは、部分適用したカリー化 Proc を返します。

@param arity 引数の個数を指定します。可変長の引数を指定できるメソッドを
カリー化する際には必ず指定する必要があります。

//emlist[例][ruby]{
def foo(a,b,c)
[a, b, c]
end

proc = self.method(:foo).curr...

Module#ruby2_keywords(method_name, ...) -> nil (18400.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 (18400.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 ...

SystemCallError#errno -> Integer | nil (18004.0)

レシーバに対応するシステム依存のエラーコードを返します。

レシーバに対応するシステム依存のエラーコードを返します。

エラーコードを渡さない形式で生成した場合は nil を返します。

begin
raise Errno::ENOENT
rescue Errno::ENOENT => err
p err.errno # => 2
p Errno::ENOENT::Errno # => 2
end

begin
raise SystemCallError, 'message'
rescue SystemCallError => err
p err.e...

Proc#yield(*arg) -> () (9307.0)

手続きオブジェクトを実行してその結果を返します。

手続きオブジェクトを実行してその結果を返します。

引数の渡され方はオブジェクトの生成方法によって異なります。
詳しくは Proc#lambda? を参照してください。

「===」は when の所に手続きを渡せるようにするためのものです。

//emlist[例][ruby]{
def sign(n)
case n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1...

絞り込み条件を変える

Symbol#to_proc -> Proc (9058.0)

self に対応する Proc オブジェクトを返します。

self に対応する Proc オブジェクトを返します。

生成される Proc オブジェクトを呼びだす(Proc#call)と、
Proc#callの第一引数をレシーバとして、 self という名前のメソッドを
残りの引数を渡して呼びだします。


//emlist[明示的に呼ぶ例][ruby]{
:to_i.to_proc["ff", 16] # => 255 ← "ff".to_i(16)と同じ
//}

//emlist[暗黙に呼ばれる例][ruby]{
# メソッドに & とともにシンボルを渡すと
# to_proc が呼ばれて Proc 化され、
# それがブロックとして渡される...

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

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

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

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

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

: severity

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

: time

このメッ...

LocalJumpError#reason -> Symbol (340.0)

例外を発生させた原因をシンボルで返します。

例外を発生させた原因をシンボルで返します。

返す値は以下のいずれかです。

* :break
* :redo
* :retry
* :next
* :return
* :noreason

例:

def foo
proc { return 10 }
end

begin
foo.call
rescue LocalJumpError => err
p err # => #<LocalJumpError: return from block-closure>
p err.reason ...

TracePoint#event -> Symbol (340.0)

発生したイベントの種類を Symbol で返します。

発生したイベントの種類を Symbol で返します。

発生するイベントの詳細については、TracePoint.new を参照してくださ
い。

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

//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call, :return) do |tp|
p tp.event
end
trace.enable
foo 1
# => :call
# :return
//}

TracePoint#method_id -> Symbol | nil (322.0)

イベントが発生したメソッドの定義時の名前を Symbol で返します。 トップレベルであった場合は nil を返します。

イベントが発生したメソッドの定義時の名前を Symbol で返します。
トップレベルであった場合は nil を返します。

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

//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end

trace = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_id] # => [:method_name, :alias_name]
e...

絞り込み条件を変える