lib/slack-ruby-bot/commands/base.rb in slack-ruby-bot-0.8.0 vs lib/slack-ruby-bot/commands/base.rb in slack-ruby-bot-0.8.1
- old
+ new
@@ -22,10 +22,14 @@
def send_gif(client, channel, keywords, options = {})
logger.warn '[DEPRECATION] `send_gif` is deprecated. Please use `client.say` instead.'
client.say(options.merge(channel: channel, text: '', gif: keywords))
end
+ def help(&block)
+ CommandsHelper.instance.capture_help(name, &block)
+ end
+
def default_command_name
name && name.split(':').last.downcase
end
def operator(*values, &block)
@@ -67,15 +71,15 @@
end if expression
called
end
def match(match, &block)
- self.routes ||= {}
+ self.routes ||= ActiveSupport::OrderedHash.new
self.routes[match] = { match_method: :match, call: block }
end
def scan(match, &block)
- self.routes ||= {}
+ self.routes ||= ActiveSupport::OrderedHash.new
self.routes[match] = { match_method: :scan, call: block }
end
private