class GothamDice

Another example of creating a custom set of dice

Constants

DATA_FILE_NAME

path to yml file

DEFAULT_READERS

The Readers to use in order, in this case, use ‘_’ to split face names

(allowing single faces with multiple results), then cancel all of the
opposing results, then present the results as a frequency hash
OPPOSING

which faces are considered opposing, and thus cancel out in CancelOpposing

readers

Public Class Methods

get(rng = nil) click to toggle source

simple way to get a bag of dice with optional rng @return [GothamDice]

# File lib/gotham_dice.rb, line 40
def self.get(rng = nil)
  hash = YAML.load_file(DATA_FILE_NAME)
  self.new(name: 'Gotham Dice', dice: hash, rng: rng)
end