Class: CoinFlip::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/coin_flip/cli.rb

Class Method Summary collapse

Class Method Details

.flipObject

def self.all

@@all

end



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/coin_flip/cli.rb', line 13

def self.flip
  random = [0, 1].sample
  toss = ""

  if random == 0
    toss = "Heads"
  else
    toss = "Tails"
  end

  # -- extra code for later use --

  # self.all << toss

  return toss
end