def pages
      @pages ||= begin
        from = @page - (@size / 2).ceil
        from = 1 if from < 1
        upto = from + @size - 1

        # Correct +from+ and +to+ if +to+ is more than number of pages
        if upto > pages_count
          from -= (upto - pages_count)
          from = 1 if from < 1
          upto = pages_count
        end

        (from..upto).to_a
      end
    end
def pages
      @pages ||= begin
        from = @page - (@size / 2).ceil
        from = 1 if from < 1
        upto = from + @size - 1

        # Correct +from+ and +to+ if +to+ is more than number of pages
        if upto > pages_count
          from -= (upto - pages_count)
          from = 1 if from < 1
          upto = pages_count
        end

        (from..upto).to_a
      end
    end
Number of pages to display.

 @return [Array<Integer>]