lib/slack-ruby-bot/commands/base.rb in slack-ruby-bot-0.7.0 vs lib/slack-ruby-bot/commands/base.rb in slack-ruby-bot-0.8.0
- old
+ new
@@ -5,11 +5,11 @@
class_attribute :routes
class << self
def send_message(client, channel, text, options = {})
logger.warn '[DEPRECATION] `send_message` is deprecated. Please use `client.say` instead.'
- if text && text.length > 0
+ if text && !text.length.empty?
client.say(options.merge(channel: channel, text: text))
else
client.say(options.merge(channel: channel, text: 'Nothing to see here.', gif: 'nothing'))
end
end
@@ -59,10 +59,10 @@
if call
call.call(client, data, match)
elsif respond_to?(:call)
send(:call, client, data, match)
else
- fail NotImplementedError, data.text
+ raise NotImplementedError, data.text
end
break
end if expression
called
end