Created
December 22, 2010 00:03
-
-
Save sgonyea/750848 to your computer and use it in GitHub Desktop.
I love Enumerable
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
# @param [true, false] qt Whether or not Keywords are surrounded by quotes | |
# @return [Array] The list of all Keyword-words (with quotes if specified) | |
def self.all_words(qt=false) | |
words = select(:word).map(&:word) | |
qt && words.map(&:inspect) || words | |
end |
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
# :nodoc: because bad enumator-folks also hate documentation and things like life | |
def self.all_words(qt=false) | |
words = [] | |
select(:word).each {|w| | |
words << (qt ? w.word.inspect : w.word) | |
} | |
words | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment