Class: Pumi::DataSource::Wikipedia::CambodianCommunesScraper

Inherits:
Object
  • Object
show all
Defined in:
lib/pumi/data_source/wikipedia.rb

Constant Summary collapse

URL =
"https://en.wikipedia.org/wiki/List_of_communes_in_Cambodia".freeze

Instance Method Summary collapse

Instance Method Details

#scrape!Object



163
164
165
166
167
168
169
170
171
# File 'lib/pumi/data_source/wikipedia.rb', line 163

def scrape!
  Commune.all.each_with_object([]) do |commune, result|
    result << ScraperResult.new(
      code: commune.id,
      wikipedia: find_url(commune),
      name_ungegn: find_ungegn(commune)
    )
  end
end