るりまサーチ

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

別のキーワード

  1. _builtin name
  2. resolv each_name
  3. win32ole name
  4. net/imap name
  5. openssl name

ライブラリ

モジュール

検索結果

<< 1 2 > >>

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

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

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

@param severity ログレベル。

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

@param progname プログラム名

@param msg メッセージ。...

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

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

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

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

TracePoint#callee_id -> Symbol | nil (6143.0)

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

...した場合に発生します。

//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]
end
trace.enable do
C.new.alias_name
end
//}

@see TracePoint#method_id...

Module#ruby2_keywords(method_name, ...) -> nil (134.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...
..., 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 p...
...s it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the module responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.

//emlist[...

Module#instance_method(name) -> UnboundMethod (130.0)

self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。

...self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。

@param name メソッド名を Symbol または String で指定します。

@raise NameError self に存在しないメソッドを指定した場合に発生します。

@see Module#publ...
...d(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end

interpreter = Interpreter.new
interpreter.interpret('dave')
# => Hello there, Dave!
//}...

絞り込み条件を変える

Object#method(name) -> Method (130.0)

オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。

...オブジェクトのメソッド name をオブジェクト化した
Method オブジェクトを返します。

@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。

//em...
...list[][ruby]{
me = -365.method(:abs)
p me #=> #<Method: Integer#abs>
p me.call #=> 365
//}

@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#singleton_method...

Object#singleton_method(name) -> Method (130.0)

オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。

...オブジェクトの特異メソッド name をオブジェクト化した Method オブ
ジェクトを返します。

@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します...
...o.new(99)
def k.hi
"Hi, @iv = #{@iv}"
end
m = k.singleton_method(:hi) # => #<Method: #<Demo:0xf8b0c3c4 @iv=99>.hi>
m.call #=> "Hi, @iv = 99"
m = k.singleton_method(:hello) # => NameError
//}

@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#method...

BasicObject#instance_eval(expr, filename = "(eval)", lineno = 1) -> object (125.0)

オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。

...ルの定数が Object 以下に作成されるためです。

@param expr 評価する文字列です。

@param filename 文字列を指定します。ファイル filename に文字列 expr が
書かれているかのように実行されます。スタックトレースの...
...(RuntimeError)
//}

//emlist[例][ruby]{
class Bar < BasicObject
def call1
instance_eval("::ENV.class")
end
def call2
instance_eval("ENV.class")
end
end

bar = Bar.new
bar.call1 # => Object
bar.call2 # raise NameError
//}

@see Module#module_eval, Kernel.#eval, BasicObject#instance_...

MiniTest::Assertions#assert_respond_to(object, method_name, message = nil) -> true (114.0)

与えられたオブジェクトが与えられたメソッドを持つ場合、検査にパスしたことになります。

...を指定します。

@param method_name メソッド名を指定します。

@param message 検査に失敗した場合に表示するメッセージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用...

TracePoint#method_id -> Symbol | nil (43.0)

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

...した場合に発生します。

//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]
end
trace.enable do
C.new.alias_name
end
//}

@see TracePoint#callee_id...

絞り込み条件を変える

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

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

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

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

: s...
...のメッセージが記録された時刻を表す Time オブジェクト。

: progname

無視されます。互換性のために用意されています。

: message

記録するメッセージ。

call
メソッドは文字列を返す必要があります。

@see Syslog::Logger#format...
<< 1 2 > >>