Module: Tacokit::Client::Searches

Included in:
Tacokit::Client
Defined in:
lib/tacokit/client/searches.rb

Overview

Methods for the Search API

Instance Method Summary collapse

Instance Method Details

#search(query, options = {}) ⇒ Object

Search across resources with a query

Examples:

Search for any resource with query “technology”

Tacokit.search("technology") #=> Tacokit::Collection

Search for cards with query “music”

Tacokit.search("music", model_types: "cards") #=> Tacokit::Collection

Parameters:

  • query (String)

    the text of the search query

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

    options to retrieve the search results with

Returns:

  • the search results

See Also:


15
16
17
# File 'lib/tacokit/client/searches.rb', line 15

def search(query, options = {})
  get search_path, options.merge(query: query)
end

#search_members(query, options = {}) ⇒ Object

Search members with a query

Examples:

Search for members with query “Marsha”

Tacokit.search("Marsha") #=> Tacokit::Collection<Member>

Parameters:

  • query (String)

    the text of the search query

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

    options to retrieve the search results with

Returns:

  • the search results


25
26
27
# File 'lib/tacokit/client/searches.rb', line 25

def search_members(query, options = {})
  get search_path("members"), options.merge(query: query)
end