Class: Lita::Handlers::Crazycaps

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

Instance Method Summary collapse

Instance Method Details

#crazycaps(response) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/lita/handlers/crazycaps.rb', line 10

def crazycaps(response)
  phrase = response.matches[0][0]
  phrase_cc = ''

  phrase.each_char do |c|
    phrase_cc += [true, false].sample ? c.downcase : c.upcase
  end

  response.reply(phrase_cc)
end