lib/access/response.rb in access-2.0.25 vs lib/access/response.rb in access-2.0.26
- old
+ new
@@ -1,9 +1,20 @@
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, :member_usage, :offer_count_in_categories, :offer_count_by_redemption_method, :offer_count_by_facet, :custom_aggregation, :internal_details, :users, :response, :offer_redemptions, :favorites
+ #basics
+ attr_reader :info, :links, :message, :status, :success, :error, :response_status, :dev_node, :internal_details, :response
+ #resources
+ attr_reader :offers, :stores, :locations, :categories, :suggestions, :oauth_applications, :access_tokens, :oauth_tokens, :oauth_token, :verify, :reports, :members, :filters, :oauth_access_token, :users, :offer_redemptions, :favorites, :campaigns, :channels, :spots
+ #aggregations
+ attr_reader :offer_count_in_categories, :offer_count_by_redemption_method, :offer_count_by_facet, :custom_aggregation
+ #redemptions
+ attr_reader :content_type, :redemption_method, :details
+ #usages
+ attr_reader :api_calls_over_time, :member_usage
+ #campaign show page
+ attr_reader :campaign_name, :campaign_description, :start_date, :end_date, :campaign_ranking, :spot_list, :channel_list
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
@@ -140,10 +151,12 @@
end
end
class CampaignResponse < Response
def process_data
- @campaigns = Access::Campaign.process_batch(@campaigns)
+ @campaigns = Access::Campaign.process_batch(@campaigns) if @campaigns
+ @spot_list = Access::Spot.process_batch(@spot_list) if @spot_list
+ @channel_list = Access::Channel.process_batch(@channel_list) if @channel_list
end
end
class SpotResponse < Response
def process_data