Class: Word
- Inherits:
-
Object
- Object
- Word
- Defined in:
- lib/word.rb
Instance Attribute Summary collapse
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#syllable_count ⇒ Object
readonly
Returns the value of attribute syllable_count.
-
#word ⇒ Object
readonly
Returns the value of attribute word.
Instance Method Summary collapse
-
#initialize(response_hash) ⇒ Word
constructor
A new instance of Word.
Constructor Details
#initialize(response_hash) ⇒ Word
Returns a new instance of Word.
5 6 7 8 9 |
# File 'lib/word.rb', line 5 def initialize(response_hash) @word = response_hash["word"] @score = response_hash["score"] @syllable_count = response_hash["numSyllables"] end |
Instance Attribute Details
#score ⇒ Object (readonly)
Returns the value of attribute score.
3 4 5 |
# File 'lib/word.rb', line 3 def score @score end |
#syllable_count ⇒ Object (readonly)
Returns the value of attribute syllable_count.
3 4 5 |
# File 'lib/word.rb', line 3 def syllable_count @syllable_count end |
#word ⇒ Object (readonly)
Returns the value of attribute word.
3 4 5 |
# File 'lib/word.rb', line 3 def word @word end |