Class: DiceBag::StaticPart
- Inherits:
-
SimplePart
- Object
- SimplePart
- DiceBag::StaticPart
- Defined in:
- lib/dicebag/static_part.rb
Overview
This represents a static, non-random number part of the dice string.
Instance Attribute Summary
Attributes inherited from SimplePart
Instance Method Summary collapse
-
#initialize(num) ⇒ StaticPart
constructor
A new instance of StaticPart.
- #to_s ⇒ Object
- #total ⇒ Object
Methods inherited from SimplePart
Constructor Details
#initialize(num) ⇒ StaticPart
Returns a new instance of StaticPart.
5 6 7 8 |
# File 'lib/dicebag/static_part.rb', line 5 def initialize(num) num = num.to_i if num.is_a?(String) @value = num end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/dicebag/static_part.rb', line 14 def to_s value.to_s end |
#total ⇒ Object
10 11 12 |
# File 'lib/dicebag/static_part.rb', line 10 def total value end |