Module: Evrythng::Client::Search

Included in:
Evrythng::Client
Defined in:
lib/evrythng/client/search.rb

Overview

Defines methods related to Search

Instance Method Summary collapse

Instance Method Details

#search(q, options = {}) ⇒ Array

Returns thngs that match a specified query.

Examples:

Returns thngs that contain ‘bike’ in their name or description

Evrythng.search('bike')

Parameters:

  • q (String)

    A search term.

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

    A customizable set of options.

Options Hash (options):

  • :geocode (String)

    Returns thngs located within a given radius of the given latitude/longitude. The parameter value is specified by “latitude,longitude,radius”, where radius units must be specified as either “mi” (miles) or “km” (kilometers).

  • :page (Integer)

    The page number (starting at 1) to return.

  • :per_page (Integer)

    The number of thngs to return per page, up to a max of 100.

Returns:

  • (Array)

    Return thngs that match a specified query

See Also:



17
18
19
# File 'lib/evrythng/client/search.rb', line 17

def search(q, options={})
  get('search', options.merge(:q => q))
end