Class: Rock

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



39
40
41
42
43
44
45
46
47
48
# File 'lib/mousevc_rock_paper_scissors/hand.rb', line 39

def compare(hand)
  case hand
  when Rock
    return 0
  when Paper
    return -1
  when Scissors
    return 1
  end
end

#to_sObject



50
51
52
# File 'lib/mousevc_rock_paper_scissors/hand.rb', line 50

def to_s
  'rock'
end