Class: WordScramble::ScrambledWord

Inherits:
Object
  • Object
show all
Defined in:
lib/word_scramble/scrambled_word.rb

Instance Method Summary collapse

Constructor Details

#initialize(scrambled_word) ⇒ ScrambledWord

Returns a new instance of ScrambledWord.



3
4
5
# File 'lib/word_scramble/scrambled_word.rb', line 3

def initialize(scrambled_word)
  @scrambled_word = WordScramble::LetterFrequency.new(scrambled_word)
end

Instance Method Details

#can_make(word) ⇒ Object Also known as: can_make?



7
8
9
# File 'lib/word_scramble/scrambled_word.rb', line 7

def can_make(word)
  WordScramble::LetterFrequency.new(word) == @scrambled_word
end

#lengthObject



11
12
13
# File 'lib/word_scramble/scrambled_word.rb', line 11

def length
  @scrambled_word.length
end