Class: Word

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#scoreObject (readonly)

Returns the value of attribute score.



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

def score
  @score
end

#syllable_countObject (readonly)

Returns the value of attribute syllable_count.



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

def syllable_count
  @syllable_count
end

#wordObject (readonly)

Returns the value of attribute word.



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

def word
  @word
end