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 +4 -4
- data/lib/codabel/model/account.rb +15 -0
- data/lib/codabel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c64d64a812802fa82a870f34bff0ac80bc384ecdc650b3f9a1584732911aa13a
|
4
|
+
data.tar.gz: cf5feeedd9b299e02dcfd634d0753dd0ef7cab7019a02da60fd2b53b9fdd5c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/codabel/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|