module Factbook

note: make codes available

note:

the factbook category/region for world is other entities (on FAQ) and oceans in page
 changed to world

Constants

Logging

Public Class Methods

codes() click to toggle source

note: load on demand only builtin codes, comparisons, etc.

for now
# File lib/factbook-codes.rb, line 25
def self.codes
  @@codes ||= Codes.read_csv( "#{Factbook::Module::Codes.root}/data/codes.csv" );
end
region_to_slug( text ) click to toggle source

check: move region_to_slug into a utility module / helper

for (re)use - how, why? why not??
# File lib/factbook-codes/codes.rb, line 11
def self.region_to_slug( text )
  ##  change and  =>  n
  ##  change  &   =>  n
  ##  change all spaces to => -
  ##   e.g. East & Southeast Asia          => east-n-southeast-asia
  ##        Central America and Caribbean  => central-america-n-caribbean
  text.downcase.gsub('and', 'n').gsub( '&', 'n' ).gsub( ' ', '-' )
end