46件ヒット
[1-46件を表示]
(0.116秒)
種類
- インスタンスメソッド (19)
- 文書 (16)
- 定数 (11)
クラス
- CGI (11)
- Proc (13)
- TracePoint (6)
キーワード
-
MAX
_ MULTIPART _ COUNT (11) -
NEWS for Ruby 2
. 7 . 0 (5) - hash (11)
- メソッド呼び出し(super・ブロック付き・yield) (11)
検索結果
先頭5件
-
TracePoint
# parameters -> [object] (21241.0) -
現在のフックが属するメソッドまたはブロックのパラメータ定義を返します。 フォーマットは Method#parameters と同じです。
...Method#parameters と同じです。
@raise RuntimeError :call、:return、:b_call、:b_return、:c_call、:c_return
イベントのためのイベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(a, b = 2)
end
TracePoint.new(:call......) do |tp|
p tp.parameters # => a], [:opt, :b
end.enable do
foo(1)
end
//}
@see Method#parameters, UnboundMethod#parameters, Proc#parameters... -
Proc
# parameters(lambda: nil) -> [object] (18343.0) -
Proc オブジェクトの引数の情報を返します。
...。
//emlist[例][ruby]{
prc = lambda{|x, y=42, *other, k_x:, k_y: 42, **k_other, &b|}
prc.parameters #=> x], [:opt, :y], [:rest, :other], [:keyreq, :k_x], [:key, :k_y], [:keyrest, :k_other], [:block, :b
//}
//emlist[lambda: の例][ruby]{
prc = proc{|x, y=42, *other|}
p prc.parameters # => x], [.......parameters # => x], [:opt, :y], [:rest, :other
prc = proc{|x, y=42, *other|}
p prc.parameters(lambda: true) # => x], [:opt, :y], [:rest, :other
prc = lambda{|x, y=42, *other|}
p prc.parameters(lambda: false) # => x], [:opt, :y], [:rest, :other
//}
@see Method#parameters, UnboundMethod#parameters... -
CGI
:: MAX _ MULTIPART _ COUNT -> Integer (6216.0) -
Maximum number of request parameters when multipart
...Maximum number of request parameters when multipart... -
メソッド呼び出し(super・ブロック付き・yield) (3124.0)
-
メソッド呼び出し(super・ブロック付き・yield) * super * block * yield * block_arg * numbered_parameters * call_method
...メソッド呼び出し(super・ブロック付き・yield)
* super
* block
* yield
* block_arg
* numbered_parameters
* call_method
//emlist[例][ruby]{
foo.bar()
foo.bar
bar()
print "hello world\n"
print
Class.new
Class::new
//}
文法:
[式 `.'] 識別子 [`(' [[`*']......`.' と `::' とはほぼ同じ意味です。但し、定数を表す場合は、
`::' を使わなければいけません(例: Math::PI)。逆に、
//emlist[][ruby]{
Klass::Foo
//}
とした場合、常に定数と見なされるという制限があります。
`::' を、クラスメソッ......ます。
//emlist[][ruby]{
def foo
yield 1,2,3
end
foo{|v| p v} #=> 1
def bar
yield [1,2,3]
end
bar{|a, b, c| p a} #=> 1
def hoge
yield [1,2,3],4,5
end
hoge{|a, b, c| p a} #=> [1,2,3]
//}
http://www.a-k-r.org/d/2007-08.html#a2007_08_16_1
===[a:numbered_parameters] 番号指定... -
NEWS for Ruby 2
. 7 . 0 (354.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ァイルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマッチが実験的機能として導入されました。 14912
//emlist[][ruby]{
case [0, [1, 2, 3]]
in [a, [b, *c]]
p a #......nd
//}
//emlist[][ruby]{
case {a: 0, b: 1}
in {a: 0, x: 1}
:unreachable
in {a: 0, b: var}
p var #=> 1
end
//}
//emlist[][ruby]{
case -1
in 0 then :unreachable
in 1 then :unreachable
end #=> NoMatchingPatternError
//}
//emlist{
json = <<END
{
"name": "Alice",
"age": 30,
"children": [{ "n......は、コマンドライン引数に
「-W:no-deprecated」を指定するか、コードの中で
「Warning[:deprecated] = false」
としてください。
==== 番号指定パラメータ
* 番号指定パラメータ(Numbered parameters)がデフォルトのブロックの仮引... -
Proc
# hash -> Integer (224.0) -
self のハッシュ値を返します。
...Symbol の 2 要素です。
//emlist[][ruby]{
prc = proc{|x, y=42, *other|}
p prc.parameters # => x], [:opt, :y], [:rest, :other
prc = lambda{|x, y=42, *other|}
p prc.parameters # => x], [:opt, :y], [:rest, :other
prc = proc{|x, y=42, *other|}
p prc.parameters(lambda: true) # => x], [:opt, :y]......, [:rest, :other
prc = lambda{|x, y=42, *other|}
p prc.parameters(lambda: false) # => x], [:opt, :y], [:rest, :other
//}...