codabel 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad1ce84a2688c81c84314eeb6ee094beb981ca3cf73cede28c832e5be9a35ef2
4
- data.tar.gz: a40681361c5dc0495e81319df395b4134b801e05b0a6ea02d8042d7aed727721
3
+ metadata.gz: c64d64a812802fa82a870f34bff0ac80bc384ecdc650b3f9a1584732911aa13a
4
+ data.tar.gz: cf5feeedd9b299e02dcfd634d0753dd0ef7cab7019a02da60fd2b53b9fdd5c06
5
5
  SHA512:
6
- metadata.gz: 348a1e498003589ced937d1d3c29583e9da87172eff307ad48c2747bac2f64e56e55e80d9af429ee0f61b755baa928b9ad9afbca7b52aadf54857224bae369aa
7
- data.tar.gz: 8b005b1d07cd2c7911711bdd5695e8b16dfe149fefc66d1fae969771edc078057396991c61af4ccf731bd03113aab7fd487ae57628b847336d51dcf225852397
6
+ metadata.gz: a5d454bd66e45b9336e8b7d2237372ffc637cacccc0f1aaf62495d53373280d4426758f8f959b14a0f7fe605f8a51b626e06ae73e64e66aa515e97a681532fe5
7
+ data.tar.gz: 6884e896116eb9637783cb44e28b51e790b6cd6b1b303f0f425e79d62134eb1d8e0f98dbe0fcec66aa1d791a635258c1d991659544b3bed31f0c3f8c65dd6ccf
@@ -6,6 +6,21 @@ module Codabel
6
6
  BELGIAN_IBAN = :belgian_iban
7
7
  FOREIGN_IBAN = :foreign_iban
8
8
 
9
+ def initialize(attributes = {})
10
+ super(check!(attributes))
11
+ end
12
+
13
+ def check!(attributes)
14
+ attributes = attributes.dup
15
+
16
+ if (c = attributes[:currency])
17
+ c = attributes[:currency] = c.strip
18
+ raise ValidationError, "Wrong currency #{c}" unless c =~ /^[A-Z]{3}$/
19
+ end
20
+
21
+ attributes
22
+ end
23
+
9
24
  def self.dress(value)
10
25
  case value
11
26
  when Account then value
@@ -1,3 +1,3 @@
1
1
  module Codabel
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codabel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-25 00:00:00.000000000 Z
11
+ date: 2022-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake