class ScrabbleScore::WordFinder

Public Class Methods

new(dictionary = ScrabbleScore::Dictionary.new) click to toggle source
# File lib/scrabble_score/word_finder.rb, line 3
def initialize(dictionary = ScrabbleScore::Dictionary.new)
  @dictionary = dictionary
end

Public Instance Methods

search_with_score(letters) click to toggle source
# File lib/scrabble_score/word_finder.rb, line 12
def search_with_score(letters)
  found_words = search(letters)

  hash = {}
  found_words.each do |word|
    hash[word] = ScrabbleScore::Letters.new(word).score
  end

  hash
end