steuer 1.0.2 → 1.0.3

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: 6107cfb43de3e4dcacf51cb3a4b85c08ebf7081ca45834249621b15cc8df8cf6
4
- data.tar.gz: ad9055e07cfbaf7444b34041d02f4de0f677fd9980ec071667e7c96dba4772a5
3
+ metadata.gz: 932dd3009320b708e4141a8e90092717d30efc0792550dcaf2161ab16f4bcc7a
4
+ data.tar.gz: '0219a890034b58541a5f797fa62ab6174186ff7be964c0946bacda4a122f3272'
5
5
  SHA512:
6
- metadata.gz: 721f6a1e1d195277baae919f14adac51fdff9c8777f5fbfc4eea23e70a3d6afa0e9d82f5daf6ac6bac397abc07ec4e0c88b6c1ebc4c0b3b15320aea0e216116c
7
- data.tar.gz: 81ad730bc621bd8201e597a4df1cc240db1c752eb1c4be1b351e5c31fa3abb5345c17718e63db8d1678c79cb4c9327b672496d3668009ae61814bcd99a1d3206
6
+ metadata.gz: 8d978823b3e9a45da0f859f2acdf1a0bcaebc0b67c94f9d41229f6be5dc1a73c150806facbcf9286661c180f46cc537c038c2c077c46ca989221b2def85a2ee9
7
+ data.tar.gz: a560bef4902b511e2befb2b6ffe367ffae2758ecc7cea147a05fbde419561737dfa7ebc0d64032f3ca776ab6c367a044177f8045fb565b98bc1376519354c252
@@ -133,9 +133,20 @@ module Steuer
133
133
  end
134
134
  end
135
135
 
136
- sorted_states.each do |code, config|
137
- return code if tax_number.match?(config[:standard_pattern])
136
+ # Find all states that match the pattern
137
+ matching_states = sorted_states.select do |_code, config|
138
+ tax_number.match?(config[:standard_pattern])
138
139
  end
140
+
141
+ # If only one state matches, return it (unambiguous)
142
+ return matching_states.first[0] if matching_states.length == 1
143
+
144
+ # If multiple states match (ambiguous), return nil
145
+ # This will trigger the error requiring explicit state parameter
146
+ # (same behavior as ambiguous federal prefixes like '3' or '4')
147
+ return if matching_states.length > 1
148
+
149
+ # No matches
139
150
  nil
140
151
  end
141
152
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Steuer
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steuer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olumuyiwa Osiname
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-02 00:00:00.000000000 Z
11
+ date: 2025-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '2.14'
125
125
  description: A Ruby gem for German tax system utilities including Steuernummer conversion
126
- between formats, VAT validation, and other tax-related functionality
126
+ between formats, and other tax-related functionality.
127
127
  email:
128
128
  - oluosiname@gmail.com
129
129
  executables: []