Module: Oddb2xml::TxtExtractorMethods
- Included in:
- BMUpdateExtractor, LppvExtractor
- Defined in:
- lib/oddb2xml/extractor.rb
Instance Method Summary collapse
Instance Method Details
#initialize(str) ⇒ Object
12 13 14 |
# File 'lib/oddb2xml/extractor.rb', line 12 def initialize(str) @io = StringIO.new(str) end |
#to_hash ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/oddb2xml/extractor.rb', line 15 def to_hash data = {} while line = @io.gets next unless line =~ /\d{13}/ ean = line.chomp.gsub("\"", '') data[ean] = true end data end |