class Rpsdz::Hand

hand

Attributes

name[RW]

Public Class Methods

new(h) click to toggle source
# File lib/hand.rb, line 6
def initialize(h)
  @name = h.downcase
  if !["r","p","s"].include?@name
    raise "Invalid input"
  end
end
random() click to toggle source
# File lib/hand.rb, line 13
def self.random
  ["r","p","s"].sample
end