LoginSignup
0
0

More than 3 years have passed since last update.

Rubyのキーワード引数についてメモる

Posted at

基本

image.png

  • 呼び出し側は、指定されたキーワードのシンボルをkeyとするハッシュを引数に与える
  • 複数のキーワードを指定することも可能

デフォルト値も設定できる


def b(test:, test2: 't2')
   puts test1, test2
end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0