lib/groupie/group.rb in groupie-0.2.2 vs lib/groupie/group.rb in groupie-0.3.0
- old
+ new
@@ -1,12 +1,13 @@
class Groupie
class Group
+ attr_reader :word_counts
def initialize(name)
@name = name
@word_counts = {}
end
-
+
def words
@word_counts.keys
end
# Add new words to the group.
@@ -14,9 +15,10 @@
words.flatten.each do |word|
add_word(word)
end
nil
end
+ alias << add
# Return the count for a specific +word+.
def count(word)
@word_counts[word] || 0
end
\ No newline at end of file