Class: WordScramble::ScrambledWord
- Inherits:
-
Object
- Object
- WordScramble::ScrambledWord
- Defined in:
- lib/word_scramble/scrambled_word.rb
Instance Method Summary collapse
- #can_make(word) ⇒ Object (also: #can_make?)
-
#initialize(scrambled_word) ⇒ ScrambledWord
constructor
A new instance of ScrambledWord.
- #length ⇒ Object
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 |
#length ⇒ Object
11 12 13 |
# File 'lib/word_scramble/scrambled_word.rb', line 11 def length @scrambled_word.length end |