Module: StrawberryAPI::Client::Searches

Included in:
StrawberryAPI::Client
Defined in:
lib/strawberry_api/client/searches.rb

Instance Method Summary collapse

Instance Method Details

#search(term:, order_by: 'updated_at', order: 'desc', per_page: 10, page: 1, projects: true, assets: true) ⇒ Hash

Searches for a term through projects and/or assets

Parameters:

  • term (String)
  • [String] (Hash)

    a customizable set of options

  • [Integer] (Hash)

    a customizable set of options

  • [Boolean] (Hash)

    a customizable set of options

Returns:

  • (Hash)

    A list of projets and/or assets matching the search term



17
18
19
20
21
# File 'lib/strawberry_api/client/searches.rb', line 17

def search(term:, order_by: 'updated_at', order: 'desc', per_page: 10, page: 1, projects: true, assets: true)
  body = {term: term, order_by: order_by, order: order, per_page: per_page, page: page, projects: projets, assets: assets}
  
  get("/search", body: body)
end