lib/ratebeer/beer/review_set.rb
def review_chunks
        doc.flat_map do |page|
          page.css('div div')
              .children
              .select { |x| x.name == 'div' || x.name == 'small' }
              .map(&:text)
              .reject { |x| x.empty? || x.include?('googleFillSlot') }
              .each_slice(3)
              .take(@limit)
        end
      end
# Split the doc into chunks, each of which contains one review.
#
Split the doc into chunks, each of which contains one review.
Split the doc into chunks each of which contains one review .
def review_chunks
        doc.flat_map do |page|
          page.css('div div')
              .children
              .select { |x| x.name == 'div' || x.name == 'small' }
              .map(&:text)
              .reject { |x| x.empty? || x.include?('googleFillSlot') }
              .each_slice(3)
              .take(@limit)
        end
      end
def review_chunks doc . flat_map do | page | page . css ( 'div div' ) . children . select { | x | x . name == 'div' || x . name == 'small' } . map ( & :text ) . reject { | x | x . empty? || x . include? ( 'googleFillSlot' ) } . each_slice ( 3 ) . take ( @limit ) end end
Split the doc into chunks, each of which contains one review.
Split the doc into chunks each of which contains one review .