lib/ratebeer/brewery.rb
def extract_address_element(node)
        key = case node.attributes['itemprop'].value
              when 'streetAddress'   then :street
              when 'addressLocality' then :city
              when 'addressRegion'   then :state
              when 'addressCountry'  then :country
              when 'postalCode'      then :postcode
              else raise 'unrecognised attribute'
              end
        [key, node.text.strip]
      end
# Extracts one element of address details from a node contained within the
# address div.
Extracts one element of address details from a node contained within the
address div.
Extracts one element of address details from a node contained within the address div .
def extract_address_element(node)
        key = case node.attributes['itemprop'].value
              when 'streetAddress'   then :street
              when 'addressLocality' then :city
              when 'addressRegion'   then :state
              when 'addressCountry'  then :country
              when 'postalCode'      then :postcode
              else raise 'unrecognised attribute'
              end
        [key, node.text.strip]
      end
def extract_address_element ( node ) key = case node . attributes [ 'itemprop' ] . value when 'streetAddress' then :street when 'addressLocality' then :city when 'addressRegion' then :state when 'addressCountry' then :country when 'postalCode' then :postcode else raise 'unrecognised attribute' end [ key , node . text . strip ] end
Extracts one element of address details from a node contained within the
address div.
Extracts one element of address details from a node contained within the address div .
node