lib/access/response.rb in access-2.0.4 vs lib/access/response.rb in access-2.0.5
- old
+ new
@@ -1,9 +1,9 @@
module Access
class Response
- attr_accessor :info, :offers, :stores, :locations, :categories, :suggestions, :oauth_applications, :access_tokens, :oauth_tokens, :oauth_token, :verify, :reports, :members, :filters, :links, :dev_node, :message, :status, :success, :error, :response_status, :content_type, :redemption_method, :details, :oauth_access_token, :api_calls_over_time, :total_api_calls, :time_period, :interval, :report_env
+ attr_accessor :info, :offers, :stores, :locations, :categories, :suggestions, :oauth_applications, :access_tokens, :oauth_tokens, :oauth_token, :verify, :reports, :members, :filters, :links, :dev_node, :message, :status, :success, :error, :response_status, :content_type, :redemption_method, :details, :oauth_access_token, :api_calls_over_time, :member_query_terms, :member_postal_codes, :total_api_calls, :time_period, :interval, :report_env
def initialize(response)
response.each { |key, value| instance_variable_set("@#{key}", value) if self.class.instance_methods.include? key.to_sym }
@response_status = response.message
@status ||= response.code
@@ -100,10 +100,12 @@
end
end
class ReportResponse < Response
def process_data
- @api_calls_over_time = Access::Report.process_batch(@api_calls_over_time)
+ @api_calls_over_time = Access::Report.process_batch(@api_calls_over_time) if @api_calls_over_time
+ @member_query_terms = Access::Report.process_batch(@member_query_terms) if @member_query_terms
+ @member_postal_codes = Access::Report.process_batch(@member_postal_codes) if @member_postal_codes
end
end
class MemberResponse < Response
def process_data