Sha256: d2e335ff5225419e97393098c08c367e66cd27cd1c61c7a66a16aa1c3ca7c8f3

Contents?: true

Size: 491 Bytes

Versions: 6

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true

# A class responsible for proxing to faraday response &
# or a pagination collection.
module ActionKitRest
  module Response
    class Collection
      include Enumerable

      attr_reader :meta, :objects

      def initialize(meta, objects)
        @meta = meta
        @objects = objects
      end

      def each(&block)
        # TODO: handle pagination somehow!
        objects.each do |o|
          block.call(o)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
action_kit_rest-0.4.10 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.9 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.8 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.7 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.6 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.5 lib/action_kit_rest/response/collection.rb