Sha256: 952f2cf91ed7f5251bfbefa6d3018b0358877dfb91adc9c316a80b71762b0907

Contents?: true

Size: 739 Bytes

Versions: 14

Compression:

Stored size: 739 Bytes

Contents

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

module ConstantContact
  module Components
    class ResultSet
      attr_accessor :results, :next


      # Constructor to create a ResultSet from the results/meta response when performing a get on a collection
      # @param [Array<Hash>] results - results array from request
      # @param [Hash] meta - meta hash from request
      def initialize(results, meta)
        @results = results

        if meta.has_key?('pagination') and meta['pagination'].has_key?('next_link')
          next_link = meta['pagination']['next_link']
          @next = next_link[next_link.index('?'), next_link.length]
        end
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
constantcontact-4.0.0 lib/constantcontact/components/result_set.rb
constantcontact-3.0.0 lib/constantcontact/components/result_set.rb
constantcontact-2.2.1 lib/constantcontact/components/result_set.rb
constantcontact-2.2.0 lib/constantcontact/components/result_set.rb
constantcontact-2.1.0 lib/constantcontact/components/result_set.rb
constantcontact-2.0.1 lib/constantcontact/components/result_set.rb
constantcontact-2.0.0 lib/constantcontact/components/result_set.rb
constantcontact-1.3.2 lib/constantcontact/components/result_set.rb
constantcontact-1.2.0 lib/constantcontact/components/result_set.rb
constantcontact-1.1.2 lib/constantcontact/components/result_set.rb
constantcontact-1.1.1 lib/constantcontact/components/result_set.rb
constantcontact-1.1.0 lib/constantcontact/components/result_set.rb
constantcontact-1.0.2 lib/constantcontact/components/result_set.rb
constantcontact-1.0.1 lib/constantcontact/components/result_set.rb