lib/sqed/extractor.rb in sqed-0.1.5 vs lib/sqed/extractor.rb in sqed-0.1.6
- old
+ new
@@ -40,13 +40,14 @@
metadata_map.each do |section_index, section_type|
# only extract data if a parser exists
if parsers = SqedConfig::SECTION_PARSERS[section_type]
section_image = r.send("#{section_type}_image")
+
updated = r.send(section_type)
parsers.each do |p|
- parsed_result = p.new(section_image).text
+ parsed_result = p.new(section_image).text(section_type: section_type)
updated.merge!(p::TYPE => parsed_result) if parsed_result
end
r.send("#{section_type}=", updated)
end