# File scripts/harvester-main.rb, line 17 def parse(ad) # If we were passed a String, convert it to an Ad. ad = Ad.new(ad) if ad.class == String attrs = Hash.new @pr.rules.each do |rule| #puts "applying #{rule.match.inspect}" results = ad.apply_rule(rule) results.each do |f,v| attrs[f] = v if not attrs[f] end end return ad end