module ParaDice::Die
@abstract A module meant to be the basis of a custom Die
object with
behaviour included from this die.
@see GothamDice
@see StarWarsDice
Constants
- ERROR_MSG
Public Instance Methods
face_count()
click to toggle source
@abstract Implement in Include-able Module and override {#face_count} to implement
a custom Threadable class.
# File lib/para_dice/die.rb, line 44 def face_count raise NotImplementedError.new ('face_count' + ERROR_MSG) end
faces()
click to toggle source
@abstract Implement in Include-able Module and override {#face_count} to implement
a custom Threadable class.
# File lib/para_dice/die.rb, line 56 def faces raise NotImplementedError.new ('faces' + ERROR_MSG) end
random_face(this_rng = rng)
click to toggle source
@abstract Implement in Include-able Module and override {#face_count} to implement
a custom Threadable class.
# File lib/para_dice/die.rb, line 50 def random_face(this_rng = rng) raise NotImplementedError.new ('random_face' + ERROR_MSG) end
roll(roll_rng = rng)
click to toggle source
for overloading and calling super on to allow more complex arrangements of
face and dice behavior modules
@param [Random] roll_rng @return [Object] random face from die
# File lib/para_dice/die.rb, line 38 def roll(roll_rng = rng) random_face(roll_rng) end
Private Instance Methods
quit_if_no_name()
click to toggle source
# File lib/para_dice/die.rb, line 61 def quit_if_no_name raise ArgumentError.new('no :name entry found in initialization hash') end