Sha256: 0e4457c983248e8bd492026a90cc8977f0a3b967f4a14909ebc657369d6a5d70

Contents?: true

Size: 1.03 KB

Versions: 14

Compression:

Stored size: 1.03 KB

Contents

module Access
  class Autocomplete
    include Access::MuchMeta

    def self.search(options = {})
      Access::Api.new.autocomplete options
    end

    def self.search_stores(options = {})
      Access::Api.new.autocomplete options.merge(resources: 'stores')
    end

    def self.search_categories(options = {})
      Access::Api.new.autocomplete options.merge(resources: 'categories')
    end

    def self.search_offers(options = {})
      Access::Api.new.autocomplete options.merge(resources: 'offers')
    end

    def self.search_locations(options = {})
      Access::Api.new.autocomplete options.merge(resources: 'locations')
    end

    def initialize(values)
      @used_fields = []
      set_up_methods(values)
      set_values(values)
      @offers = Access::Offer.process_batch(@offers) if @offers
      @stores = Access::Store.process_batch(@stores) if @stores
      @locations = Access::Location.process_batch(@locations) if @locations
      @categories = Access::Category.process_batch(@categories) if @categories
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
access-2.3.0.pre.rc2 lib/access/autocomplete.rb
access-2.3.0.pre.rc1 lib/access/autocomplete.rb
access-2.2.0 lib/access/autocomplete.rb
access-2.1.5 lib/access/autocomplete.rb
access-2.1.4 lib/access/autocomplete.rb
access-2.1.3 lib/access/autocomplete.rb
access-2.1.2 lib/access/autocomplete.rb
access-2.1.1 lib/access/autocomplete.rb
access-2.1.0 lib/access/autocomplete.rb
access-2.0.55 lib/access/autocomplete.rb
access-2.0.54 lib/access/autocomplete.rb
access-2.0.53 lib/access/autocomplete.rb
access-2.0.52 lib/access/autocomplete.rb
access-2.0.51 lib/access/autocomplete.rb