Class: Lita::Handlers::Wordnik

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

Constant Summary collapse

NO_DEFINITIONS =
"Wordnik doesn't have any definitions for that."

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_config(config) ⇒ Object



8
9
10
# File 'lib/lita/handlers/wordnik.rb', line 8

def self.default_config(config)
  config.api_key = nil
end

Instance Method Details

#define(response) ⇒ Object



16
17
18
19
20
21
# File 'lib/lita/handlers/wordnik.rb', line 16

def define(response)
  return unless validate(response)
  word = response.matches[0][0]
  definition = get_definition(word)
  response.reply(definition)
end