Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 482 Bytes

color_ghost.md

File metadata and controls

23 lines (18 loc) · 482 Bytes

Description

Color Ghost

Create a class Ghost

Ghost objects are instantiated without any arguments.

Ghost objects are given a random color attribute of "white" or "yellow" or "purple" or "red" when instantiated

ghost = Ghost.new
ghost.color  #=> "white" or "yellow" or "purple" or "red"

My Solution

class Ghost
  def color
    %w(white yellow purple red).sample
  end
end