Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
キーワード引数(デフォルト値なし)のサンプルソース
# 引数を元にメッセージを表示する
def display_message(name:, message:)
p "#{name} : #{message}"
end
display_message(name: 'John', message: 'Hello')
display_message(message: 'Hello', name: 'John')
display_message
display_message('John', 'Hello')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment