Module: Slack::Endpoint::Reminders

Included in:
Slack::Endpoint
Defined in:
lib/slack/endpoint/reminders.rb

Instance Method Summary collapse

Instance Method Details

#reminders_add(options = {}) ⇒ Object

This method creates a reminder.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :text (Object)

    The content of the reminder

  • :time (Object)

    When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. “in 15 minutes,” or “every Thursday”)

  • :user (Object)

    The user who will receive the reminder. If no user is specified, the reminder will go to user who created it.

See Also:



18
19
20
21
22
23
# File 'lib/slack/endpoint/reminders.rb', line 18

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?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reminders.add", options)
end

#reminders_complete(options = {}) ⇒ Object

This method completes a reminder.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :reminder (Object)

    The ID of the reminder to be marked as complete

See Also:



33
34
35
36
37
# File 'lib/slack/endpoint/reminders.rb', line 33

def reminders_complete(options={})
  throw ArgumentError.new("Required arguments :reminder missing") if options[:reminder].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reminders.complete", options)
end

#reminders_delete(options = {}) ⇒ Object

This method deletes a reminder.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :reminder (Object)

    The ID of the reminder

See Also:



47
48
49
50
51
# File 'lib/slack/endpoint/reminders.rb', line 47

def reminders_delete(options={})
  throw ArgumentError.new("Required arguments :reminder missing") if options[:reminder].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reminders.delete", options)
end

#reminders_info(options = {}) ⇒ Object

This method returns information about a reminder.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :reminder (Object)

    The ID of the reminder

See Also:



61
62
63
64
65
# File 'lib/slack/endpoint/reminders.rb', line 61

def reminders_info(options={})
  throw ArgumentError.new("Required arguments :reminder missing") if options[:reminder].nil?
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reminders.info", options)
end

#reminders_list(options = {}) ⇒ Object

This method lists all reminders created by or for a given user.



73
74
75
76
# File 'lib/slack/endpoint/reminders.rb', line 73

def reminders_list(options={})
  options[:attachments] = options[:attachments].to_json if Hash === options[:attachments]
  post("reminders.list", options)
end