module Yahtzee
This module is the imperative shell of sorts. It provides the ‘DSL’ of the Yahtzee
library and is mostly a wrapper for internals, ‘gluing’ the application together from a bunch of functions into a cohesive playable game.
Immutable via API, I will work on freezing this later, but notice that when you ‘save’ you are not altering THIS instance, you return a new instance with the old and the new attributes
Yahtzee::Scoring
is our mechnism for scoring dice to placement spots on the score card. If the method is located here, it will include a callback you can define. Right now it is used for writing the value to the object, but you could print the value instead.
Notice there is no direct coupling of type between this and the possible caller, just a contract on the params
Yahtzee
is the namespace for the whole project it is therefore used in every file. Every file also need access to our error defs, so that is here as well.
Constants
- SCORINGS
- VERSION