Class: DiceBox::Dice::Side
- Inherits:
-
Object
- Object
- DiceBox::Dice::Side
- Defined in:
- lib/dice_box/dice/side.rb
Overview
Representation of the side of a dice
Instance Attribute Summary collapse
-
#value ⇒ Integer
The actual value of the Side.
-
#weight ⇒ Float
The weight of the Side.
Instance Method Summary collapse
-
#initialize(value, weight = 1.0) ⇒ Side
constructor
A new instance of Side.
Constructor Details
#initialize(value, weight = 1.0) ⇒ Side
Returns a new instance of Side.
15 16 17 18 |
# File 'lib/dice_box/dice/side.rb', line 15 def initialize(value, weight = 1.0) @value = value @weight = weight end |
Instance Attribute Details
#value ⇒ Integer
Returns the actual value of the Side.
7 8 9 |
# File 'lib/dice_box/dice/side.rb', line 7 def value @value end |
#weight ⇒ Float
Returns the weight of the Side.
11 12 13 |
# File 'lib/dice_box/dice/side.rb', line 11 def weight @weight end |