Class: Cognition::Plugins::Default

Inherits:
Base
  • Object
show all
Defined in:
lib/cognition/plugins/default.rb

Instance Attribute Summary

Attributes inherited from Base

#matchers

Instance Method Summary collapse

Methods inherited from Base

definitions, #initialize, match

Constructor Details

This class inherits a constructor from Cognition::Plugins::Base

Instance Method Details

#help(msg, match_data = nil) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/cognition/plugins/default.rb', line 11

def help(msg, match_data = nil)
  if match_data["command"].empty?
    Cognition.help.join("\n")
  else
    Cognition.help.find_all { |text| text.match msg.matches[:command] }.join("\n")
  end
end

#pong(msg, match_data = nil) ⇒ Object



7
8
9
# File 'lib/cognition/plugins/default.rb', line 7

def pong(msg, match_data = nil)
  'PONG'
end