class Lita::Handlers::Doubler

Public Instance Methods

double_number(n) click to toggle source
# File lib/lita/handlers/doubler.rb, line 11
def double_number(n)
  n + n
end
respond_with_double(response) click to toggle source
# File lib/lita/handlers/doubler.rb, line 15
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