Class: BubBot::Slack::Command
- Inherits:
-
Object
- Object
- BubBot::Slack::Command
show all
- Defined in:
- lib/bub_bot/slack/command.rb
Defined Under Namespace
Classes: Claim, Deploy, Echo, List, Release
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options) ⇒ Command
Returns a new instance of Command.
15
16
17
18
|
# File 'lib/bub_bot/slack/command.rb', line 15
def initialize(options)
@options = options
puts "initialized a command"
end
|
Class Method Details
.aliases ⇒ Object
10
11
12
13
|
# File 'lib/bub_bot/slack/command.rb', line 10
def self.aliases
[self.name.demodulize.downcase]
end
|
.can_handle?(command) ⇒ Boolean
6
7
8
|
# File 'lib/bub_bot/slack/command.rb', line 6
def self.can_handle?(command)
aliases.include?(command)
end
|
Instance Method Details
#run ⇒ Object
20
21
22
23
|
# File 'lib/bub_bot/slack/command.rb', line 20
def run
name = self.class.name
raise "Your command #{name} needs to implement 'run'"
end
|