lib/ratebeer/beer.rb
def scrape_glassware
        glassware_elements = doc.css("a[href^='/ShowGlassware.asp']")
        @glassware = glassware_elements.map do |el|
          [:id, :name].zip([el['href'].split('GWID=').last.to_i, el.text]).to_h
        end
      end
# Each key represents an item of data accessible for each beer. The
# included scraping module defines dynamically a series of methods for
# accessing this data.
#
Each key represents an item of data accessible for each beer. The
included scraping module defines dynamically a series of methods for
accessing this data.
Each key represents an item of data accessible for each beer . The included scraping module defines dynamically a series of methods for accessing this data .
def scrape_glassware
        glassware_elements = doc.css("a[href^='/ShowGlassware.asp']")
        @glassware = glassware_elements.map do |el|
          [:id, :name].zip([el['href'].split('GWID=').last.to_i, el.text]).to_h
        end
      end
def scrape_glassware glassware_elements = doc . css ( "a[href^='/ShowGlassware.asp']" ) @glassware = glassware_elements . map do | el | [ :id , :name ] . zip ( [ el [ 'href' ] . split ( 'GWID=' ) . last . to_i , el . text ] ) . to_h end end
Each key represents an item of data accessible for each beer.
Each key represents an item of data accessible for each beer .