るりまサーチ

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

別のキーワード

  1. prime next
  2. _builtin next
  3. date next_day
  4. date next
  5. date next_month

ライブラリ

モジュール

検索結果

Kernel.#lambda { ... } -> Proc (18258.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...します。


また、lambda に & 引数を渡すのは推奨されません。& 引数ではなくてブロック記法で記述する必要があります。

& 引数を渡した lambda は Warning[:deprecated] = true のときに警告メッセージ
「warning: lambda without a literal block...
...proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続き...
...ロックでは yield、それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next
1
2 # この行に到達することはない
}
end

p foo().call...
...proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
proc(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続き...

Kernel.#lambda -> Proc (18241.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続きを中断して値を返す

手続きオブジェクトを中断して、呼出し元(呼...
...ロックでは yield、それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next
1
2 # この行に到達することはない
}
end

p foo().call...

Kernel.#lambda { ... } -> Proc (18241.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続きを中断して値を返す

手続きオブジェクトを中断して、呼出し元(呼...
...ロックでは yield、それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next
1
2 # この行に到達することはない
}
end

p foo().call...

Kernel.#proc { ... } -> Proc (3158.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...します。


また、lambda に & 引数を渡すのは推奨されません。& 引数ではなくてブロック記法で記述する必要があります。

& 引数を渡した lambda は Warning[:deprecated] = true のときに警告メッセージ
「warning: lambda without a literal block...
...proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続き...
...ロックでは yield、それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next
1
2 # この行に到達することはない
}
end

p foo().call...
...proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
proc(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続き...

Kernel.#proc -> Proc (3141.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続きを中断して値を返す

手続きオブジェクトを中断して、呼出し元(呼...
...ロックでは yield、それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next
1
2 # この行に到達することはない
}
end

p foo().call...

絞り込み条件を変える

Kernel.#proc { ... } -> Proc (3141.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続きを中断して値を返す

手続きオブジェクトを中断して、呼出し元(呼...
...ロックでは yield、それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next
1
2 # この行に到達することはない
}
end

p foo().call...

Kernel.#proc -> Proc (3140.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続きを中断して値を返す

手続きオブジェクトを中断して、呼出し元(呼...
...ロックでは yield、それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next
1
2 # この行に到達することはない
}
end

p foo().call...

Kernel.#proc { ... } -> Proc (3140.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

ブロックを指定しない lambda は Ruby 2.6 までは警告メッセージ
「warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
Argument...
...省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo &block
lambda
(&block)
end

it = foo{p 12}
it.call #=> 12
//}

@see Proc,Proc.new

===[a:should_use_next] 手続きを中断して値を返す

手続きオブジェクトを中断して、呼出し元(呼...
...ロックでは yield、それ以外では Proc#call)
へジャンプし値を返すには next を使います。break や return ではありません。


//emlist[例][ruby]{
def foo
f = Proc.new{
next
1
2 # この行に到達することはない
}
end

p foo().call...