Sha256: 85f7f6726f49b5ee66fdd760bbfc0c6ebbd6e7078d7dd8602c5f946864b8a337

Contents?: true

Size: 477 Bytes

Versions: 18

Compression:

Stored size: 477 Bytes

Contents

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

      attr_reader :meta
      attr_reader :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

18 entries across 18 versions & 1 rubygems

Version Path
action_kit_rest-0.4.4 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.3 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.2 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.1 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.4.0 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.8 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.7 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.6 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.5 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.4 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.3 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.2 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.1 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.3.0 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.2.2 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.2.1 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.2.0 lib/action_kit_rest/response/collection.rb
action_kit_rest-0.1.1 lib/action_kit_rest/response/collection.rb