Class: Lita::Handlers::Wordnik

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

Constant Summary collapse

NO_RESULTS =
"Wordnik doesn't have any results for that."

Class Method Summary collapse

Class Method Details

.define_wordnik_method(name, getter_name) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/lita/handlers/wordnik.rb', line 27

def define_wordnik_method(name, getter_name)
  define_method(name) do |response|
    word = encode_word(response.matches[0][0])
    result = send(getter_name, word)
    response.reply(result)
  end
end