Class: Cinch::Plugins::BokunoBibletoads

Inherits:
Object
  • Object
show all
Includes:
Cinch::Plugin
Defined in:
lib/cinch/plugins/bokunobibletoads.rb

Instance Method Summary collapse

Instance Method Details

#execute(m) ⇒ Object


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cinch/plugins/bokunobibletoads.rb', line 11

def execute(m)
  words = %w{ bible black battle toads boku pico }
  name = []
  4.times {
    e = words.sample
    name << e
    words.delete(e)
  }
  name.map {|e| e.capitalize }

  part_no = [true,false].sample
  two_parts_a = [true,false].sample
  two_parts_b = [true,false].sample

  format = "#{two_parts_a ? "%s%s" : "%s"}#{part_no ? " no " : ""}#{two_parts_b ? "%s%s" : "%s"}"

  m.reply(format % name)
end