Class: Tablescript::RollStrategy
- Inherits:
-
Object
- Object
- Tablescript::RollStrategy
- Defined in:
- lib/tablescript/roll_strategy.rb
Overview
RollStrategy
Instance Method Summary collapse
-
#initialize(table, roller = nil) ⇒ RollStrategy
constructor
A new instance of RollStrategy.
- #roll ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(table, roller = nil) ⇒ RollStrategy
Returns a new instance of RollStrategy.
23 24 25 26 27 28 |
# File 'lib/tablescript/roll_strategy.rb', line 23 def initialize(table, roller = nil) @table = table @roller = roller || RpgLib::DiceRoller.instance @roll = nil @value = nil end |
Instance Method Details
#roll ⇒ Object
30 31 32 33 |
# File 'lib/tablescript/roll_strategy.rb', line 30 def roll evaluate @roll end |
#value ⇒ Object
35 36 37 38 |
# File 'lib/tablescript/roll_strategy.rb', line 35 def value evaluate @value end |