Module: Schatter::Command

Included in:
ConversationContext, RootContext
Defined in:
lib/schatter/commands.rb

Defined Under Namespace

Classes: CreateConversation, CreateMessage, DeleteMessage, InvitePerson, JoinConversation, ListConversations, ListMessages, ListPeople, ReplyToMessage

Instance Method Summary collapse

Instance Method Details

#classify(s) ⇒ Object



7
8
9
# File 'lib/schatter/commands.rb', line 7

def classify s
  s.to_s.split('_').map(&:capitalize).join
end

#load_command(name, *args) ⇒ Object



2
3
4
5
# File 'lib/schatter/commands.rb', line 2

def load_command name, *args
  require "schatter/command/#{name}"
  Schatter::Command.const_get(classify name.to_s).new(*args)
end