Class: Paper
- Inherits:
-
Hand
show all
- Defined in:
- lib/mousevc_rock_paper_scissors/hand.rb
Instance Method Summary
collapse
Methods inherited from Hand
#<, #<=, #<=>, #==, #>, #>=, #beats?, #ties?
Instance Method Details
#compare(hand) ⇒ Object
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/mousevc_rock_paper_scissors/hand.rb', line 56
def compare(hand)
case hand
when Rock
return 1
when Paper
return 0
when Scissors
return -1
end
end
|
#to_s ⇒ Object
67
68
69
|
# File 'lib/mousevc_rock_paper_scissors/hand.rb', line 67
def to_s
'paper'
end
|