module Boggler::Dice

Constants

BOGGLE_DICE
STATIC_BOGGLE
STATIC_DICE

Public Instance Methods

get(opts = {}) click to toggle source
# File lib/boggler/dice.rb, line 53
def get(opts = {})
  opts ||= {}

  case opts[:method]
  when :random
    random_dice
  when :boggle
    BOGGLE_DICE.shuffle
  when :big_boggle
    [
      BOGGLE_DICE.shuffle,
      BOGGLE_DICE.shuffle,
      BOGGLE_DICE.shuffle,
      BOGGLE_DICE.shuffle,
    ].flatten
  when :static
    STATIC_DICE
  else
    BOGGLE_DICE.shuffle
  end
end

Private Instance Methods

random_dice() click to toggle source
# File lib/boggler/dice.rb, line 77
def random_dice
  16.times.map do
    Die.new
  end
end