Class: ParaDice::NumberedDie
- Inherits:
-
Object
- Object
- ParaDice::NumberedDie
- Includes:
- Die, Faces::Ranged
- Defined in:
- lib/para_dice/numbered_die.rb
Overview
a standard die like d6 d10, d20, d100 or exotic like d17, d32, d11-10, d100-999
Constant Summary
Constants included from Die
Instance Attribute Summary
Attributes included from Faces::Ranged
Attributes included from Die
Class Method Summary collapse
-
.get(max) ⇒ Object
given a maximum value, return a NumberedDie with max faces from 1..max.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Object
constructor
initialize a new object, Inherited via Die from Virtus.
Methods included from Faces::Ranged
#face_count, #faces, #random_face
Methods included from Die
#face_count, #faces, #random_face, #roll
Constructor Details
#initialize(params = {}) ⇒ Object
initialize a new object, Inherited via Die from Virtus
|
# File 'lib/para_dice/numbered_die.rb', line 9
|
Class Method Details
.get(max) ⇒ Object
given a maximum value, return a NumberedDie with max faces from 1..max
15 16 17 |
# File 'lib/para_dice/numbered_die.rb', line 15 def self.get(max) self.new(name: "d#{max}", range: 1..max) end |