Sha256: 1231f69e2aac71cf7d368cf8144077ed0c4085d8ba6f019700eff63ff3eeaaab
Contents?: true
Size: 1 KB
Versions: 14
Compression:
Stored size: 1 KB
Contents
module Access class Offer include Access::MuchMeta 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.find_uses_remaining(offer_key, options = {}) Access::Api.new.find_offer_uses_remaining offer_key, options end def self.process_batch(chunk) chunk.map { |offer| new(offer) } end def initialize(values) @used_fields = [] set_up_methods(values) set_values(values) @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 @offer_uses_remaining = Access::Redemption.new(@offer_uses_remaining) if @offer_uses_remaining end def location @offer_store.physical_location end def store @offer_store end end end
Version data entries
14 entries across 14 versions & 1 rubygems