Sha256: ffee08ea960dc5e8a44af23d095f35b0ee1434a452554e0d69315ee07009226f
Contents?: true
Size: 918 Bytes
Versions: 16
Compression:
Stored size: 918 Bytes
Contents
# frozen_string_literal: true module ISO3166 module Emoji 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 # @return [String] the emoji flag for this country # # The emoji flag for this country, using Unicode Regional Indicator characters. e.g: "U+1F1FA U+1F1F8" for 🇺🇸 def emoji_flag alpha2.downcase.chars.map { |c| CODE_POINTS[c] }.join end end end
Version data entries
16 entries across 16 versions & 1 rubygems