Created
February 26, 2013 22:51
-
-
Save tigawa/5043111 to your computer and use it in GitHub Desktop.
ruby 2.0 keyword param
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 count_word_from_file(path: "~/default.txt", word:"default") | |
file = File.read(path) | |
return file.split.select{|w| w==word}.size | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment