Sha256: e77330038f55c6417ffeef99ab8b4ee1f5c121e54922e29b880c4f5bad7fc9bb

Contents?: true

Size: 391 Bytes

Versions: 7

Compression:

Stored size: 391 Bytes

Contents

# frozen_string_literal: true

module Bitly
  module API
    ##
    # A base class for lists of API resources. Implements Enumerable.
    class List
      include Enumerable

      attr_reader :response

      def initialize(items:, response:)
        @items = items
        @response = response
      end

      def each
        @items.each { |item| yield item }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bitly-3.0.0 lib/bitly/api/list.rb
bitly-2.1.0 lib/bitly/api/list.rb
bitly-2.0.2 lib/bitly/api/list.rb
bitly-2.0.1 lib/bitly/api/list.rb
bitly-2.0.0 lib/bitly/api/list.rb
bitly-2.0.0.beta.2 lib/bitly/api/list.rb
bitly-2.0.0.beta.1 lib/bitly/api/list.rb