Module: ISO3166::Emoji

Included in:
Country
Defined in:
lib/countries/country/emoji.rb

Constant Summary collapse

CODE_POINTS =
{
  'a' => '🇦',
  'b' => '🇧',
  'c' => '🇨',
  'd' => '🇩',
  'e' => '🇪',
  'f' => '🇫',
  'g' => '🇬',
  'h' => '🇭',
  'i' => '🇮',
  'j' => '🇯',
  'k' => '🇰',
  'l' => '🇱',
  'm' => '🇲',
  'n' => '🇳',
  'o' => '🇴',
  'p' => '🇵',
  'q' => '🇶',
  'r' => '🇷',
  's' => '🇸',
  't' => '🇹',
  'u' => '🇺',
  'v' => '🇻',
  'w' => '🇼',
  'x' => '🇽',
  'y' => '🇾',
  'z' => '🇿'
}.freeze

Instance Method Summary collapse

Instance Method Details

#emoji_flagObject


35
36
37
# File 'lib/countries/country/emoji.rb', line 35

def emoji_flag
  alpha2.downcase.chars.map { |c| CODE_POINTS[c] }.join('')
end