Class: Lita::Handlers::DoublerTestSelly

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

Instance Method Summary collapse

Instance Method Details

#double_number(n) ⇒ Object



20
21
22
# File 'lib/lita/handlers/doubler_test_selly.rb', line 20

def double_number(n)
  n + n
end

#respond_with_double(response) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/lita/handlers/doubler_test_selly.rb', line 12

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