Sha256: cbb31ee914a863b87035fea870dddcfcb0cc5a54aeb895a320ba09295e74f1d8

Contents?: true

Size: 792 Bytes

Versions: 1

Compression:

Stored size: 792 Bytes

Contents

#
# tracking_activity.rb
# ConstantContact
#
# Copyright (c) 2013 Constant Contact. All rights reserved.

module ConstantContact
  module Components
    class TrackingActivity < Component
      attr_accessor :results, :next


      # Constructor to create a TrackingActivity from the results/pagination response from getting a set of activities
      # @param [Array] results - results array from a tracking endpoint
      # @param [Hash] pagination - pagination hash returned from a tracking endpoint
      # @return [TrackingActivity]
      def initialize(results, pagination)
        @results = results

        if (pagination.has_key?('next'))
          @next = pagination['next'][pagination['next'].index('&next=') + 6, pagination['next'].length]
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
constantcontact-1.0.1 lib/constantcontact/components/tracking/tracking_activity.rb