Class: BCDice::CommonCommand::RerollDice::Node::Notation

Inherits:
Object
  • Object
show all
Defined in:
lib/bcdice/common_command/reroll_dice/node.rb

Instance Method Summary collapse

Constructor Details

#initialize(times, sides) ⇒ Notation

Returns a new instance of Notation.



166
167
168
169
# File 'lib/bcdice/common_command/reroll_dice/node.rb', line 166

def initialize(times, sides)
  @times = times
  @sides = sides
end

Instance Method Details

#to_dice(round_type) ⇒ Object



171
172
173
174
175
176
# File 'lib/bcdice/common_command/reroll_dice/node.rb', line 171

def to_dice(round_type)
  times = @times.eval(round_type)
  sides = @sides.eval(round_type)

  Dice.new(times, sides)
end