るりまサーチ

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

別のキーワード

  1. command arguments
  2. buildcommand arguments
  3. dependencycommand arguments
  4. rubygems/command arguments
  5. configfile handle_arguments

ライブラリ

クラス

検索結果

Rake::TaskArguments#[](key) -> object (21119.0)

与えられたパラメータ名に対応する値を返します。

...の名前を指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
arguments
= Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments
["name1"] # => "value1"
arguments
["name2"] # => "value2"
end
//}...

Proc#curry -> Proc (31.0)

Procをカリー化します

...#=> 6
p b.curry[1, 2][3, 4] #=> wrong number of arguments (given 4, expected 3)
p b.curry(5) #=> wrong number of arguments (given 5, expected 3)
p b.curry(1) #=> wrong number of arguments (given 1, expected 3)

b = lambda {|x, y, z, *w| (x||0) + (y||0...
...0) + w.sum }
p b.curry[1][2][3] #=> 6
p b.curry[1, 2][3, 4] #=> 10
p b.curry(5)[1][2][3][4][5] #=> 15
p b.curry(5)[1, 2][3, 4][5] #=> 15
p b.curry(1) #=> wrong number of arguments (given 1, expected 3+)

b = proc { :foo }
p b.curry[] #=> :foo
//}...

Proc#curry(arity) -> Proc (31.0)

Procをカリー化します

...#=> 6
p b.curry[1, 2][3, 4] #=> wrong number of arguments (given 4, expected 3)
p b.curry(5) #=> wrong number of arguments (given 5, expected 3)
p b.curry(1) #=> wrong number of arguments (given 1, expected 3)

b = lambda {|x, y, z, *w| (x||0) + (y||0...
...0) + w.sum }
p b.curry[1][2][3] #=> 6
p b.curry[1, 2][3, 4] #=> 10
p b.curry(5)[1][2][3][4][5] #=> 15
p b.curry(5)[1, 2][3, 4][5] #=> 15
p b.curry(1) #=> wrong number of arguments (given 1, expected 3+)

b = proc { :foo }
p b.curry[] #=> :foo
//}...