def [](*args)
      offset, limit = extract_slice_arguments(*args)

      if args.size == 1 && args.first.kind_of?(Integer)
        return at(offset)
      end

      query = sliced_query(offset, limit)

      if loaded? || partially_loaded?(offset, limit)
        new_collection(query, super)
      else
        new_collection(query)
      end
    end
def [](*args)
      offset, limit = extract_slice_arguments(*args)

      if args.size == 1 && args.first.kind_of?(Integer)
        return at(offset)
      end

      query = sliced_query(offset, limit)

      if loaded? || partially_loaded?(offset, limit)
        new_collection(query, super)
      else
        new_collection(query)
      end
    end
Simulates Array#slice and returns a new Collection
 whose query has a new offset or limit according to the
 arguments provided.

 If you provide a range, the min is used as the offset
 and the max minues the offset is used as the limit.

 @param [Integer, Array(Integer), Range] *args
   the offset, offset and limit, or range indicating first and last position

 @return [Resource, Collection, nil]
   The entry which resides at that offset and limit,
   or a new Collection object with the set limits and offset
 @return [nil]
   The offset (or starting offset) is out of range

 @raise [ArgumentError] "arguments may be 1 or 2 Integers,
   or 1 Range object, was: #{args.inspect}"

 @api public