Method: Cinch::Plugins::Dicebag::Bag#initialize

Defined in:
lib/cinch/plugins/dicebag/bag.rb

#initialize(dice_hash) ⇒ Bag

Create a new bag

Parameters:

  • dice_hash (Hash)

    Hash of dice, in the format of { :num_sides => :max_dice_to_roll, … } The bag will randomly roll (1-:max_dice_to_roll) :num_sided dice.



12
13
14
15
16
17
# File 'lib/cinch/plugins/dicebag/bag.rb', line 12

def initialize(dice_hash)
  fail unless good_hash?(dice_hash)
  @dice = dice_hash
  @count = 0
  @score = 0
end