Class: Pumi::Bot::Wikipedia::CommunesInCambodiaArticle::Province

Inherits:
Location
  • Object
show all
Defined in:
lib/pumi/bot/wikipedia/communes_in_cambodia_article.rb

Instance Method Summary collapse

Methods inherited from Location

#communes_summary

Instance Method Details

#communesObject



47
48
49
# File 'lib/pumi/bot/wikipedia/communes_in_cambodia_article.rb', line 47

def communes
  Pumi::Commune.where(province_id: id)
end

#districtsObject



43
44
45
# File 'lib/pumi/bot/wikipedia/communes_in_cambodia_article.rb', line 43

def districts
  Pumi::District.where(province_id: id).map { |district| District.new(district) }
end

#villages_countObject



51
52
53
# File 'lib/pumi/bot/wikipedia/communes_in_cambodia_article.rb', line 51

def villages_count
  Pumi::Village.where(province_id: id).count
end