Class: BCDice::CommonCommand::BarabaraDice::Node::Notation

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

Instance Method Summary collapse

Constructor Details

#initialize(times, sides) ⇒ Notation

Returns a new instance of Notation.

Parameters:

  • times (#eval)
  • sides (#eval)


56
57
58
59
# File 'lib/bcdice/common_command/barabara_dice/node.rb', line 56

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

Instance Method Details

#to_dice(round_type) ⇒ Object

Parameters:

  • round_type (Symbol)


62
63
64
65
66
67
# File 'lib/bcdice/common_command/barabara_dice/node.rb', line 62

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

  Dice.new(times, sides)
end