def near_pages
      @near_pages ||= begin
        if current_page <= near + 1
          upper_page = shown_page_count >= last_page ? last_page : shown_page_count
          1..upper_page
        elsif current_page >= last_page - near - 1
          bottom_page = last_page - shown_page_count + 1
          (bottom_page > 1 ? bottom_page : 1)..last_page
        else
          bottom_page = current_page - near
          upper_page = current_page + near
          (bottom_page > 1 ? bottom_page : 1)..(upper_page < last_page ? upper_page : last_page)
        end
      end
    end
def near_pages
      @near_pages ||= begin
        if current_page <= near + 1
          upper_page = shown_page_count >= last_page ? last_page : shown_page_count
          1..upper_page
        elsif current_page >= last_page - near - 1
          bottom_page = last_page - shown_page_count + 1
          (bottom_page > 1 ? bottom_page : 1)..last_page
        else
          bottom_page = current_page - near
          upper_page = current_page + near
          (bottom_page > 1 ? bottom_page : 1)..(upper_page < last_page ? upper_page : last_page)
        end
      end
    end
pages that numbers are displayed