module Pixiv
  # @abstract
  class IllustList < Page
    include PageCollection

    attr_reader :page
    attr_reader :count

    def page_class
      Page
    end

    alias illust_hashes page_hash # TODO: pluralize PageCollection#page_hash
    alias illust_urls page_urls
  end

  module IllustList::WithClient
    include Page::WithClient
    include Enumerable

    def each
      illust_hashes.each do |attrs|
        url = attrs.delete(:url)
        yield Illust.lazy_new(attrs) { client.agent.get(url) }
      end
    end
  end
end
Add new IllustList, the base class for illust list
Add new IllustList, the base class for illust list
