Class: WorldDb::PartReader

Inherits:
ReaderBaseWithMoreAttribs show all
Defined in:
lib/worlddb/readers/state.rb

Instance Method Summary collapse

Methods inherited from ReaderBaseWithMoreAttribs

from_file, from_string, from_zip, #initialize, #skip_tags?, #strict?

Methods included from TextUtils::ValueHelper

#is_state?, #match_city, #match_country, #match_metro, #match_metro_flag, #match_metro_pop, #match_state_for_country, #match_supra, #match_supra_flag

Constructor Details

This class inherits a constructor from WorldDb::ReaderBaseWithMoreAttribs

Instance Method Details

#readObject



21
22
23
24
25
26
27
28
# File 'lib/worlddb/readers/state.rb', line 21

def read
  reader = ValuesReader.from_string( @text, @more_attribs )

  reader.each_line do |attribs, values|
    opts = { skip_tags: skip_tags? }
    Part.create_or_update_from_attribs( attribs, values, opts )
  end
end