chilean_rut 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chilean_rut.rb +15 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c11b43cf1e6887ce65e47e8b77c3c63f02923689
|
4
|
+
data.tar.gz: ad25aaff5f746f81e57df09ef45755e514f14bf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0380a6595e75211e561d48f82a5aff9a17dbb784fbc1cf3d1461fc75c140aae5f4e725b6154a50350e0213a99ae37483b502dc5d9409ce5d4285cd8cb2578e3d'
|
7
|
+
data.tar.gz: 38982ba43ac0bf04b21d79f737edb66bcdcb5d24b16b73def7ec978f6856dfe1ad9f3e89a848fc001e0e926b769ab25acd238224790e10c30d06dce7240b8fe0
|
data/lib/chilean_rut.rb
CHANGED
@@ -33,6 +33,21 @@ class RUT
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
##
|
37
|
+
#obfuscated R.U.T with string
|
38
|
+
#
|
39
|
+
#This function returns string with RUT obfuscated
|
40
|
+
def self.obfuscated(rut, replace_string = 'X', obfuscated_len = 2, obfuscated_dv = true)
|
41
|
+
rut = self.get_rut_and_dv(rut)
|
42
|
+
|
43
|
+
rut[:rut][rut[:rut].length - obfuscated_len, rut[:rut].length] = replace_string * obfuscated_len
|
44
|
+
rut[:dv] = (obfuscated_dv) ? replace_string : rut[:dv]
|
45
|
+
|
46
|
+
rut = self.format("#{rut[:rut]}-#{rut[:dv]}")
|
47
|
+
|
48
|
+
return rut
|
49
|
+
end
|
50
|
+
|
36
51
|
##
|
37
52
|
#Given a R.U.T. including its Digito Verificador (whatever the format, i.e. with or without points & hyphens)
|
38
53
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chilean_rut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gonzalo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.5.2
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Formato y validacion de RUT Chileno
|