lib/access/response.rb in access-2.0.53 vs lib/access/response.rb in access-2.0.54
- old
+ new
@@ -17,10 +17,12 @@
attr_reader :spot_name, :spot_text, :spot_ranking, :spot_redirect_url, :spot_redirect_type, :spot_image_url, :offer_resource
#channel show page
attr_reader :channel_name, :channel_type, :channel_identifier, :channel_description
#shopping cart count
attr_reader :total_cart_count
+ #amt
+ attr_reader :data
def initialize(response)
@response = response # Setting this temporarily so i can have a working member reg call, since it doesn't follow the resource [] best practices
response.each { |key, value| instance_variable_set("@#{key}", value) if self.class.instance_methods.include? key.to_sym }
@response_status = response.message
@@ -219,9 +221,19 @@
end
class GeolocationResponse < Response
def process_data
@locations = Access::Geolocation.process_batch(@locations) if @locations
+ end
+ end
+
+ class AmtResponse < Response
+ def process_data
+ @data = Access::Amt.process_batch(@data) if @data
+ end
+
+ def all_valid?
+ @data.all?{|import| import.invalid_members_count.zero? }
end
end
end