class WordCounter
Attributes
count[R]
name[R]
Public Class Methods
new(filename)
click to toggle source
# File lib/genderstat/word_counter.rb, line 6 def initialize filename @words = Set.new YAML.load_file(filename) @name = filename.split('_').first.split('/').last @count = 0 end
Public Instance Methods
is_in_here?(word_in_question)
click to toggle source
# File lib/genderstat/word_counter.rb, line 12 def is_in_here? word_in_question @count += 1 if @words.include? word_in_question end