Sha256: c5718fc8542b4154b1d22cf6661a74f70fa570c8f723e0d700b067343b51a9cf
Contents?: true
Size: 880 Bytes
Versions: 19
Compression:
Stored size: 880 Bytes
Contents
module Access class Offer attr_reader :store, :location def self.search(options = {}) Access::Api.new.search_offers options end def self.find(offer_key, options = {}) Access::Api.new.find_offer offer_key, options end def self.process_batch(chunk) chunk.map { |offer| new(offer) } 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 @categories = Access::Category.process_batch(@categories) if @categories @links = Access::Link.new(@links) if @links @offer_store = Access::Store.new(@offer_store) if @offer_store end def location @offer_store.physical_location end def store @offer_store end end end
Version data entries
19 entries across 19 versions & 1 rubygems