Sha256: 4dcb6625eec217b3d83c1ff42a392a214773d6b13ec7706a1aee81062b6250e3
Contents?: true
Size: 1.11 KB
Versions: 46
Compression:
Stored size: 1.11 KB
Contents
module Access class Autocomplete 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) self.class.class_eval {attr_reader *values.keys } values.each do |attribute_name, attribute_value| self.instance_variable_set("@#{attribute_name}", attribute_value) end @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
46 entries across 46 versions & 1 rubygems