Sha256: 2ae919c7f34cb70f13cba6144b41e001bd913a9759809a4801df6c3d4d6708e9
Contents?: true
Size: 539 Bytes
Versions: 1
Compression:
Stored size: 539 Bytes
Contents
module Lita module Handlers class Doubler < Handler # insert handler code here route( /^double\s+(\d+)$/i, :respond_with_double, command: true, help: {'double N' => 'prints N + N' } ) def respond_with_double(response) # Read up on the Ruby MatchData class for more options n = response.match_data.captures.first n = Integer(n) response.reply "#{n} + #{n} = #{double_number n}" end def double_number(n) n + n end Lita.register_handler(self) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lita-doubler-test-wang-0.1.0 | lib/lita/handlers/doubler.rb |