-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hey there, thanks for this great plugin. Just cam across the use case to need to subdivisionContainment. Easy access through the gem would be great.
e.g.:
module Cldr
module Export
module Data
class SubdivisionsContainment < Base
def initialize(*)
super(nil)
update(subdivision_containment: subdivision_containment)
end
def subdivision_containment
@subdivision_containment ||= doc.xpath("supplementalData/subdivisionContainment/subgroup").each_with_object(
Hash.new { |h, k| h[k] = { contains: [] } }
) do |territory, memo|
territory_id = territory.attribute("type").value
children = territory.attribute("contains").value.split(" ")
memo[territory_id][:contains].concat(children)
memo[territory_id][:contains].sort!
end
end
end
end
end
end
Metadata
Metadata
Assignees
Labels
No labels