Class: WorldDb::StateReader

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



7
8
9
10
11
12
13
14
# File 'lib/worlddb/readers/state.rb', line 7

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

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