lib/slack/web/api/endpoints/reminders.rb in slack-ruby-client-1.1.0 vs lib/slack/web/api/endpoints/reminders.rb in slack-ruby-client-2.0.0

- old
+ new

@@ -20,12 +20,12 @@ # @option options [user] :user # The user who will receive the reminder. If no user is specified, the reminder will go to user who created it. # @see https://api.slack.com/methods/reminders.add # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.add.json def reminders_add(options = {}) - throw ArgumentError.new('Required arguments :text missing') if options[:text].nil? - throw ArgumentError.new('Required arguments :time missing') if options[:time].nil? + raise ArgumentError, 'Required arguments :text missing' if options[:text].nil? + raise ArgumentError, 'Required arguments :time missing' if options[:time].nil? options = options.merge(user: users_id(options)['user']['id']) if options[:user] post('reminders.add', options) end # @@ -36,11 +36,11 @@ # @option options [string] :team_id # Encoded team id, required if org token is used. # @see https://api.slack.com/methods/reminders.complete # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.complete.json def reminders_complete(options = {}) - throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil? + raise ArgumentError, 'Required arguments :reminder missing' if options[:reminder].nil? post('reminders.complete', options) end # # Deletes a reminder. @@ -50,11 +50,11 @@ # @option options [string] :team_id # Encoded team id, required if org token is used. # @see https://api.slack.com/methods/reminders.delete # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.delete.json def reminders_delete(options = {}) - throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil? + raise ArgumentError, 'Required arguments :reminder missing' if options[:reminder].nil? post('reminders.delete', options) end # # Gets information about a reminder. @@ -64,10 +64,10 @@ # @option options [string] :team_id # Encoded team id, required if org token is passed. # @see https://api.slack.com/methods/reminders.info # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/reminders/reminders.info.json def reminders_info(options = {}) - throw ArgumentError.new('Required arguments :reminder missing') if options[:reminder].nil? + raise ArgumentError, 'Required arguments :reminder missing' if options[:reminder].nil? post('reminders.info', options) end # # Lists all reminders created by or for a given user.