lib/ratebeer/scraping.rb
# Determine the number of pages in a document.
#
# @param [Nokogiri::Doc] doc Nokogiri document to test for pagination
# @return [Integer] Number of pages in the document
#
Determine the number of pages in a document.
Determine the number of pages in a document .
def page_count(doc)
      doc.at_css('.pagination') && doc.at_css('.pagination')
                                      .css('b')
                                      .map(&:text)
                                      .map(&:to_i)
                                      .max
    end
def page_count ( doc ) doc . at_css ( '.pagination' ) && doc . at_css ( '.pagination' ) . css ( 'b' ) . map ( & :text ) . map ( & :to_i ) . max end
Determine the number of pages in a document.
Determine the number of pages in a document .
Number of pages in the document
Number of pages in the document
Integer
doc
doc Nokogiri document to test for pagination
doc Nokogiri document to test for pagination