lib/ratebeer/brewery/beer_list.rb
def process_beer_row(row)
        beer = process_beer_name_cell(row.css('td').first)
        beer[:abv] = row.css('td')[1].text.to_f
        beer[:date_added] = Date.strptime(row.css('td')[2].text, '%m/%d/%Y')
        Beer::Beer.new(id, beer.merge(process_rating_info(row)))
      end
# Process a row of data representing one beer brewed by/at a brewery.
#
# @param [Nokogiri::XML::Element] row HTML TR row wrapped as a Nokogiri
#   element
# @param [String] location the location at which a brewery's beer is brewed
#   where this location differs from the brewery's regular brewsite/venue
# @param [String] brewer the client for whom this brewery brewed the beer,
#   where the brewery is brewing for a different company/brewery
# @return [RateBeer::Beer] a beer object representing the scraped beer,
#   containing scraped attributes
#
Process a row of data representing one beer brewed by/at a brewery.
Process a row of data representing one beer brewed by / at a brewery .
def process_beer_row(row)
        beer = process_beer_name_cell(row.css('td').first)
        beer[:abv] = row.css('td')[1].text.to_f
        beer[:date_added] = Date.strptime(row.css('td')[2].text, '%m/%d/%Y')
        Beer::Beer.new(id, beer.merge(process_rating_info(row)))
      end
def process_beer_row ( row ) beer = process_beer_name_cell ( row . css ( 'td' ) . first ) beer [ :abv ] = row . css ( 'td' ) [ 1 ] . text . to_f beer [ :date_added ] = Date . strptime ( row . css ( 'td' ) [ 2 ] . text , '%m/%d/%Y' ) Beer :: Beer . new ( id , beer . merge ( process_rating_info ( row ) ) ) end
Process a row of data representing one beer brewed by/at a brewery.
Process a row of data representing one beer brewed by / at a brewery .
a beer object representing the scraped beer, containing scraped attributes
a beer object representing the scraped beer containing scraped attributes
RateBeer::Beer
row
brewer the client for whom this brewery brewed the beer, where the brewery is brewing for a different company/brewery
brewer the client for whom this brewery brewed the beer where the brewery is brewing for a different company / brewery