apralib 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 224a37c92a5d6d226dc47de0b91306afea784f2b
4
- data.tar.gz: d51148502133e9c5dd52597c85ef56482076f85f
3
+ metadata.gz: 8e1c3d9ef8c6aa739c7be8d71899aedda2282086
4
+ data.tar.gz: d953aab95c39d1f878c069d01abfaba639b2d821
5
5
  SHA512:
6
- metadata.gz: 9fbad13674a88ea3fe41e72b247a2d92cf5647b3714220fdffa81d36d9977865f3dabbf7cfcc78d8fc55932e690812d360fb226ec6535b7a56240758cc1639d0
7
- data.tar.gz: 873b94bd5cc2a74753a97f84ae5f8d51dbc48f1bca7aed0ce83e5c806e4efe71d182ceaf223e392574e697e92f5ccc54e6f9b6ffb1710547c2e5287069743202
6
+ metadata.gz: eaf017863402a9d98e217dbf68058f422fbad6aa4f9e240d1021c77c683c44cbf7ac33dba80c44eb110adf7bd455631384b5b1c7dd4ea05050865d54f56007eb
7
+ data.tar.gz: b3fc8bbf5d3c8ff312698df6cbfb62a0b346cf4078f454bb290302201d2ac8e52b7542f2a2f499430ef5d40e1bcc358568a0c7237c8282218c2effccf8ac6acb
@@ -3,7 +3,7 @@ module ApraService
3
3
  class Grantee
4
4
 
5
5
  SSN_REGEX = /(\d{6})([-+A])(\d{3})([0-9ABCDEFHJKLMNPRSTUVWXY])/
6
- CHECK_DIGITS = %w(0 1 2 3 4 5 6 7 8 9 A B C D E F H J K L M N P R S T U V X Y)
6
+ CHECK_DIGITS = %w(0 1 2 3 4 5 6 7 8 9 A B C D E F H J K L M N P R S T U V W X Y)
7
7
 
8
8
  attr_accessor :first_names, :last_name, :ssn, :address, :zip
9
9
 
@@ -34,8 +34,12 @@ module ApraService
34
34
  end
35
35
 
36
36
  def ssn=(ssn)
37
- Grantee.verify_ssn!(ssn)
38
- self.instance_variable_set('@ssn', ssn)
37
+ if ssn
38
+ Grantee.verify_ssn!(ssn.upcase)
39
+ self.instance_variable_set('@ssn', ssn.upcase)
40
+ else
41
+ self.instance_variable_set('@ssn', nil)
42
+ end
39
43
  end
40
44
 
41
45
  def self.verify_ssn!(ssn)
@@ -1,3 +1,3 @@
1
1
  module Apralib
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -22,6 +22,28 @@ module ApraService
22
22
 
23
23
  end
24
24
 
25
+ describe 'ssn=' do
26
+
27
+ it 'should convert the code to uppercase' do
28
+
29
+ grantee = Grantee.new
30
+ grantee.ssn = '111111-111c'
31
+ expect(grantee.ssn).to eq('111111-111C')
32
+
33
+ end
34
+
35
+ it 'should set the value to nil when passed a nil value' do
36
+
37
+ grantee = Grantee.new
38
+ grantee.ssn = '111111-111C'
39
+ grantee.ssn = nil
40
+ expect(grantee.ssn).to be_nil
41
+
42
+ end
43
+
44
+
45
+ end
46
+
25
47
  end
26
48
 
27
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apralib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Sandrini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-08 00:00:00.000000000 Z
11
+ date: 2014-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler