Class: Lita::Handlers::Die

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/die.rb

Instance Method Summary collapse

Instance Method Details

#roll(response) ⇒ Object



10
11
12
13
14
# File 'lib/lita/handlers/die.rb', line 10

def roll(response)
  choices = response.matches.flatten.first.split(',')
  response.reply('Performing complex, mathematical randomization...')
  response.reply(%Q(The result: "#{choices.sample.strip}"))
end