Created
January 28, 2013 03:43
-
-
Save yangsu/4652844 to your computer and use it in GitHub Desktop.
Ruby Named Parameters
This file contains hidden or 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 tell_the_truth(options={}) | |
| if options[:profession] == :lawyer | |
| 'it could be believed that this is almost certainly not false.' | |
| else | |
| true | |
| end | |
| end | |
| tell_the_truth | |
| # => true | |
| tell_the_truth( :profession => :lawyer ) | |
| # => "it could be believed that this is almost certainly not false. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment