Module: Slack::Endpoint::Search

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

Instance Method Summary collapse

Instance Method Details

#search_all(options = {}) ⇒ Object

Searches for messages and files matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query. May contains booleans, etc.

  • :sort (Object)

    Return matches sorted by either ‘score` or `timestamp`.

  • :sort_dir (Object)

    Change sort direction to ascending (‘asc`) or descending (`desc`).

  • :highlight (Object)

    Pass a value of ‘1` to enable query highlight markers (see below).

See Also:



20
21
22
23
# File 'lib/slack/endpoint/search.rb', line 20

def search_all(options={})
  throw ArgumentError.new("Required arguments :query missing") if options[:query].nil?
  post("search.all", options)
end

#search_files(options = {}) ⇒ Object

Searches for files matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query. May contains booleans, etc.

  • :sort (Object)

    Return matches sorted by either ‘score` or `timestamp`.

  • :sort_dir (Object)

    Change sort direction to ascending (‘asc`) or descending (`desc`).

  • :highlight (Object)

    Pass a value of ‘1` to enable query highlight markers (see below).

See Also:



39
40
41
42
# File 'lib/slack/endpoint/search.rb', line 39

def search_files(options={})
  throw ArgumentError.new("Required arguments :query missing") if options[:query].nil?
  post("search.files", options)
end

#search_messages(options = {}) ⇒ Object

Searches for messages matching a query.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :query (Object)

    Search query. May contains booleans, etc.

  • :sort (Object)

    Return matches sorted by either ‘score` or `timestamp`.

  • :sort_dir (Object)

    Change sort direction to ascending (‘asc`) or descending (`desc`).

  • :highlight (Object)

    Pass a value of ‘1` to enable query highlight markers (see below).

See Also:



58
59
60
61
# File 'lib/slack/endpoint/search.rb', line 58

def search_messages(options={})
  throw ArgumentError.new("Required arguments :query missing") if options[:query].nil?
  post("search.messages", options)
end