def each(&block)
      per_page = @each_batch_size
      page = 0

      loop do
        entities = get_paginated_entities(per_page, page)
        break if entities.empty?

        entities.each do |entity|
          block_given? ? block.call(entity) : yield(entity)
        end

        page += 1
      end
    end
def each(&block)
      per_page = @each_batch_size
      page = 0

      loop do
        entities = get_paginated_entities(per_page, page)
        break if entities.empty?

        entities.each do |entity|
          block_given? ? block.call(entity) : yield(entity)
        end

        page += 1
      end
    end
Sets up the EntitySet to permit querying for the resources in the set.

 @param options [Hash] the options to setup the EntitySet
 @return [OData::EntitySet] an instance of the EntitySet
 Provided for Enumerable functionality

 @param block [block] a block to evaluate
 @return [OData::Entity] each entity in turn from this set