class DiceBag
Public Instance Methods
^(max)
click to toggle source
# File lib/dicebag.rb, line 40 def ^(max) @max = max Die.new(sides: max) end
roll(what: self, plus: 0, keep: nil, how_many: nil)
click to toggle source
# File lib/dicebag.rb, line 45 def roll(what: self, plus: 0, keep: nil, how_many: nil) raise "Must include :how_many if you pass an individual Die" unless how_many keep = how_many if keep.nil? DicePool.new set: how_many.times.collect{ what.clone.reroll }, top: keep, plus: plus end