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 +4 -4
- data/lib/steuer/state_mapping.rb +13 -2
- data/lib/steuer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 932dd3009320b708e4141a8e90092717d30efc0792550dcaf2161ab16f4bcc7a
|
|
4
|
+
data.tar.gz: '0219a890034b58541a5f797fa62ab6174186ff7be964c0946bacda4a122f3272'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d978823b3e9a45da0f859f2acdf1a0bcaebc0b67c94f9d41229f6be5dc1a73c150806facbcf9286661c180f46cc537c038c2c077c46ca989221b2def85a2ee9
|
|
7
|
+
data.tar.gz: a560bef4902b511e2befb2b6ffe367ffae2758ecc7cea147a05fbde419561737dfa7ebc0d64032f3ca776ab6c367a044177f8045fb565b98bc1376519354c252
|
data/lib/steuer/state_mapping.rb
CHANGED
|
@@ -133,9 +133,20 @@ module Steuer
|
|
|
133
133
|
end
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
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
|
|
data/lib/steuer/version.rb
CHANGED
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.
|
|
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-
|
|
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
|
|
126
|
+
between formats, and other tax-related functionality.
|
|
127
127
|
email:
|
|
128
128
|
- oluosiname@gmail.com
|
|
129
129
|
executables: []
|