lib/access/redemption.rb in access-2.0.50 vs lib/access/redemption.rb in access-2.0.51
- old
+ new
@@ -1,7 +1,8 @@
module Access
class Redemption
+ include Access::MuchMeta
def self.search_by_member(member_key, options = {})
Access::Api.new.search_offer_redemptions_by_member member_key, options
end
@@ -12,13 +13,12 @@
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
+ @used_fields = []
+ set_up_methods(values)
+ set_values(values)
@offer = Access::Offer.new(@offer) if @offer
@member = Access::Member.new(@member) if @member
end
end