lib/ratebeer/brewery/beer_list.rb
# Processes information on who the beer was brewed for or by, or at.
Processes information on who the beer was brewed for or by, or at.
Processes information on who the beer was brewed for or by or at .
def process_brewed_at_for(node)
        brewed_at_for_node = node.at_css('div.small em')
        return {} if brewed_at_for_node.nil?
        node_text = brewed_at_for_node.children.first.text
        key = if node_text.include?('Brewed at')
                :brewed_at
              elsif node_text.include?('Brewed by/for')
                :brewed_by_for
              end
        other_brewer_node = brewed_at_for_node.at_css('a')
        { key => Brewery.new(id_from_link(other_brewer_node),
                             name: other_brewer_node.text) }
      end
def process_brewed_at_for ( node ) brewed_at_for_node = node . at_css ( 'div.small em' ) return { } if brewed_at_for_node . nil? node_text = brewed_at_for_node . children . first . text key = if node_text . include? ( 'Brewed at' ) :brewed_at elsif node_text . include? ( 'Brewed by/for' ) :brewed_by_for end other_brewer_node = brewed_at_for_node . at_css ( 'a' ) { key => Brewery . new ( id_from_link ( other_brewer_node ) , name : other_brewer_node . text ) } end
Processes information on who the beer was brewed for or by, or at.
Processes information on who the beer was brewed for or by or at .
node