Artificial intelligent assistant

Rubyの仮引数が*だけの意味とは? rails def sum(*) calculate :sum, nil end `*` * * * cul8er`initialize` > #initialzesuper#initialize(≒) rails`sum``super`rails`sum`



> * ( post )
> rest 1
>
> :
>
>
> def foo(x, *xs)
> puts "#{x} : #{xs.inspect}" # Object#inspect p
> end
> foo(1) #=> 1 : []
> foo(1, 2) #=> 1 : [2]
> foo(1, 2, 3) #=> 1 : [2, 3]
>
> def bar(x, *) #
> puts "#{x}"
> end
> bar(1) #=> 1
> bar(1, 2) #=> 1
> bar(1, 2, 3) #=> 1
>

****

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy c9661ab43e3059b7920034d97ba598b5