Class: SCRABBLR::Score
- Inherits:
-
Object
- Object
- SCRABBLR::Score
- Defined in:
- lib/score.rb
Overview
simple container for scrabble scores
Instance Attribute Summary collapse
-
#explanation ⇒ Object
Returns the value of attribute explanation.
-
#score ⇒ Object
Returns the value of attribute score.
-
#word ⇒ Object
Returns the value of attribute word.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(word, score, explanation) ⇒ Score
constructor
A new instance of Score.
- #inspect ⇒ Object
Constructor Details
#initialize(word, score, explanation) ⇒ Score
Returns a new instance of Score.
9 10 11 12 13 |
# File 'lib/score.rb', line 9 def initialize(word, score, explanation) @word = word @score = score @explanation = explanation end |
Instance Attribute Details
#explanation ⇒ Object
Returns the value of attribute explanation.
7 8 9 |
# File 'lib/score.rb', line 7 def explanation @explanation end |
#score ⇒ Object
Returns the value of attribute score.
7 8 9 |
# File 'lib/score.rb', line 7 def score @score end |
#word ⇒ Object
Returns the value of attribute word.
7 8 9 |
# File 'lib/score.rb', line 7 def word @word end |
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 |
# File 'lib/score.rb', line 19 def <=> other other.score <=> @score end |
#inspect ⇒ Object
15 16 17 |
# File 'lib/score.rb', line 15 def inspect "Scrabble score [word=#{@word}, score=#{@score}]" end |