class BCDice::CommonCommand::UpperDice::Node::Notation

Public Class Methods

new(roll_times, sides) click to toggle source

@param roll_times [Object] @param sides [Object]

# File lib/bcdice/common_command/upper_dice/node.rb, line 119
def initialize(roll_times, sides)
  @roll_times = roll_times
  @sides = sides
end

Public Instance Methods

to_dice(round_type) click to toggle source

@param round_type [Symbol] @return [Dice]

# File lib/bcdice/common_command/upper_dice/node.rb, line 126
def to_dice(round_type)
  roll_times = @roll_times.eval(round_type)
  sides = @sides.eval(round_type)

  Dice.new(roll_times, sides)
end