Sha256: e65c4e67fc0edfc4b8bf68c4f40fd088c7f9bd406f060ab4e7ca3d07f157cad0

Contents?: true

Size: 789 Bytes

Versions: 27

Compression:

Stored size: 789 Bytes

Contents

module Access
  class Redemption

    def self.search_by_member(member_key, options = {})
      Access::Api.new.search_offer_redemptions_by_member member_key, options
    end

    def self.find_by_member(member_key, usage_redeem_key, options = {})
      Access::Api.new.find_offer_redemptions_by_member member_key, usage_redeem_key, options
    end

    def self.process_batch(chunk)
      chunk.map { |redemption| new(redemption) }
    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
      @offer = Access::Offer.new(@offer) if @offer
      @member = Access::Member.new(@member) if @member
    end

  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
access-2.0.50 lib/access/redemption.rb
access-2.0.49 lib/access/redemption.rb
access-2.0.48 lib/access/redemption.rb
access-2.0.47 lib/access/redemption.rb
access-2.0.46 lib/access/redemption.rb
access-2.0.44 lib/access/redemption.rb
access-2.0.43 lib/access/redemption.rb
access-2.0.42 lib/access/redemption.rb
access-2.0.41 lib/access/redemption.rb
access-2.0.40 lib/access/redemption.rb
access-2.0.39 lib/access/redemption.rb
access-2.0.38 lib/access/redemption.rb
access-2.0.37 lib/access/redemption.rb
access-2.0.36 lib/access/redemption.rb
access-2.0.34 lib/access/redemption.rb
access-2.0.33 lib/access/redemption.rb
access-2.0.32 lib/access/redemption.rb
access-2.0.31 lib/access/redemption.rb
access-2.0.30 lib/access/redemption.rb
access-2.0.29 lib/access/redemption.rb