Sha256: bcbd5a61872265feed533c8292ba7a6ee4869c28b7987580ee950e0dbdcbf46d

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

module Evrythng
  class Client
    # Defines methods related to Search
    module Search

      # Returns thngs that match a specified query.
      #
      # @see https://dev.evrythng.com/search
      # @param q [String] A search term.
      # @param options [Hash] A customizable set of options.
      # @option options [String] :geocode 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).
      # @option options [Integer] :page The page number (starting at 1) to return.
      # @option options [Integer] :per_page The number of thngs to return per page, up to a max of 100.
      # @return [Array] Return thngs that match a specified query
      # @example Returns thngs that contain 'bike' in their name or description
      #   Evrythng.search('bike')
      def search(q, options={})
        get('search', options.merge(:q => q))
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
evrythng-0.1.1 lib/evrythng/client/search.rb
evrythng-0.1.0 lib/evrythng/client/search.rb