Last active
June 18, 2017 05:22
-
-
Save Y-Fujikawa/0156c005309e6722d858bb67c4b61817 to your computer and use it in GitHub Desktop.
キーワード引数(デフォルト値あり)のサンプルソース
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 引数を元にメッセージを表示する | |
def display_message(name: 'Smith', message: 'Sample') | |
p "#{name} : #{message}" | |
end | |
display_message | |
display_message(name: 'John', message: 'Hello') | |
display_message(message: 'Hello', name: 'John') | |
display_message('John', 'Hello') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment