eu_vat_rates_data 2026.3.31 → 2026.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9aa5cfb0609e948804ee35b2314921d7f07a8561b015a35fde1b24465e6eac39
4
- data.tar.gz: 909f7e7e7a454a4c83f10030c48e1bdcebdf2dffd96d00dfe47ef8dc017533f4
3
+ metadata.gz: 7500f7595a966f82bfd05872df2213c435275a3fff3490fa5ee767c77cd9fe47
4
+ data.tar.gz: fdb64c61041a64ca8b82b2008d515a07f37c829b792abc79970acc246c03c105
5
5
  SHA512:
6
- metadata.gz: 47f2770e396b04e9140dd3aacae12c3980eb4a0906d9fd2d6e9a5bde6ca3b75f23a29e349f4d866b5cb4065a907def92c4d4184beb580703b06e206f984cdfe0
7
- data.tar.gz: cc8cca83cf408f8a816440b86323caeb3e4f451de7c59da4ab647a4453f5f79309ac83b6cceca282b8838e9a417687b17315aec60defbf05750605e4b209b594
6
+ metadata.gz: 3a946209e638f7337d50d0f1143672a69e3bcd174993ebdbed82e021038b61004cf25a329db7041fe538c9c164e64eb5c9920ab15e48da642703973fdc5ca0ae
7
+ data.tar.gz: 12df16274ba3b96887d03fe6fb31dcfaf877ea301592acb825e2e6728e761b354e9c6411bff749a360770eb96b979f270562c01ef40894402ab58e3ad5765df8
data/README.md CHANGED
@@ -79,6 +79,11 @@ EuVatRatesData.valid_format?("INVALID") # => false
79
79
  at = EuVatRatesData.get_rate("AT")
80
80
  puts at["format"] # "ATU + 8 digits"
81
81
  puts at["pattern"] # "^ATU\\d{8}$"
82
+
83
+ # Flag emoji from a 2-letter country code — no lookup table, computed from regional indicator symbols
84
+ EuVatRatesData.flag("FI") # => "🇫🇮"
85
+ EuVatRatesData.flag("DE") # => "🇩🇪"
86
+ EuVatRatesData.flag("XX") # => "" (empty string for unknown/invalid codes)
82
87
  ```
83
88
 
84
89
  ---
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026-03-30",
2
+ "version": "2026-04-01",
3
3
  "source": "European Commission TEDB",
4
4
  "rates": {
5
5
  "AD": {
@@ -1,3 +1,3 @@
1
1
  module EuVatRatesData
2
- VERSION = "2026.3.31"
2
+ VERSION = "2026.4.1"
3
3
  end
@@ -17,6 +17,7 @@ require_relative "eu_vat_rates_data/version"
17
17
  # EuVatRatesData.eu_member?("NO") # => false
18
18
  # EuVatRatesData.eu_member?("FR") # => true
19
19
  # EuVatRatesData.data_version # => "2026-03-18"
20
+ # EuVatRatesData.flag("FI") # => "🇫🇮"
20
21
  module EuVatRatesData
21
22
  DATA_FILE = File.expand_path("../data/eu-vat-rates-data.json", __dir__)
22
23
 
@@ -86,4 +87,22 @@ module EuVatRatesData
86
87
  def self.data_version
87
88
  dataset["version"]
88
89
  end
90
+
91
+ # Return the flag emoji for a 2-letter ISO 3166-1 alpha-2 country code.
92
+ # Computed from regional indicator symbols — no lookup table needed.
93
+ # Returns an empty string if the input is not exactly 2 ASCII letters.
94
+ #
95
+ # @param country_code [String] ISO 3166-1 alpha-2 code (e.g. "FI", "DE")
96
+ # @return [String] flag emoji (e.g. "🇫🇮"), or "" if invalid
97
+ #
98
+ # @example
99
+ # EuVatRatesData.flag("FI") # => "🇫🇮"
100
+ # EuVatRatesData.flag("DE") # => "🇩🇪"
101
+ # EuVatRatesData.flag("GB") # => "🇬🇧"
102
+ def self.flag(country_code)
103
+ code = country_code.upcase
104
+ return "" unless code.length == 2 && code.match?(/\A[A-Z]{2}\z/)
105
+ base = 0x1F1E6
106
+ [base + code.ord - 65, base + code[-1].ord - 65].pack("U*")
107
+ end
89
108
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eu_vat_rates_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 2026.3.31
4
+ version: 2026.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iurii Rogulia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-30 00:00:00.000000000 Z
11
+ date: 2026-04-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: VAT rates (standard, reduced, super-reduced, parking) for 44 European
14
14
  countries — EU-27 plus Norway, Switzerland, UK, and more. Includes eu_member flag,