class Move

Constants

VALUES

Attributes

value[R]

Public Class Methods

new(value) click to toggle source
# File lib/move.rb, line 4
def initialize(value)
  @value = value
end

Public Instance Methods

>(other_move) click to toggle source
# File lib/move.rb, line 24
def >(other_move)
  (value == 'rock' && other_move.scissors?) ||
    (value == 'paper' && other_move.rock?) ||
    (value == 'scissors' && other_move.paper?)
end
paper?() click to toggle source
# File lib/move.rb, line 16
def paper?
  value == 'paper'
end
rock?() click to toggle source
# File lib/move.rb, line 12
def rock?
  value == 'rock'
end
scissors?() click to toggle source
# File lib/move.rb, line 20
def scissors?
  value == 'scissors'
end
to_s() click to toggle source
# File lib/move.rb, line 8
def to_s
  value
end