lib/ratebeer/beer.rb
# Scrapes the miscellaneous information contained on the beer page.
#
# This information relates to various other specific types of information.
# As such, other scrapers rely on this method for information.
Scrapes the miscellaneous information contained on the beer page.
This information relates to various other specific types of information.
As such, other scrapers rely on this method for information.
Scrapes the miscellaneous information contained on the beer page . This information relates to various other specific types of information . As such other scrapers rely on this method for information .
def scrape_misc
        doc.at_css('.stats-container')
           .children
           .map(&:text)
           .flat_map { |x| x.gsub(nbsp, ' ').strip.split(':') }
           .map(&:strip)
           .reject(&:empty?)
           .each_slice(2)
           .map { |(k, v)| [symbolize_text(k), v.to_f.zero? ? v : v.to_f] }
           .to_h
      end
def scrape_misc doc . at_css ( '.stats-container' ) . children . map ( & :text ) . flat_map { | x | x . gsub ( nbsp , ' ' ) . strip . split ( ':' ) } . map ( & :strip ) . reject ( & :empty? ) . each_slice ( 2 ) . map { | ( k , v ) | [ symbolize_text ( k ) , v . to_f . zero? ? v : v . to_f ] } . to_h end
Scrapes the miscellaneous information contained on the beer page.
Scrapes the miscellaneous information contained on the beer page .