chilean_rut 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chilean_rut.rb +15 -0
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9ae129e42335d59f3bc5d5df28aca797b929fd6
4
- data.tar.gz: 8d6ea2b1b15a84f8e66f0881aa619c5e69f7764b
3
+ metadata.gz: c11b43cf1e6887ce65e47e8b77c3c63f02923689
4
+ data.tar.gz: ad25aaff5f746f81e57df09ef45755e514f14bf5
5
5
  SHA512:
6
- metadata.gz: 51932f9658d3a847c7c2da715d4b2c2814abe2d2760958168f1450d030d5aa507ad03600692972bcc878754988fc6a42bf0d5769ae8d71d3861c5749b75967bc
7
- data.tar.gz: 74ff268e20956a93d7e8b8b318807ad10cc5283914ff8d399d733c722a736515a82dd68f1f89cb522cad8dc4a4c241aa2d3a20e5b594efe8f417b9de440a3aab
6
+ metadata.gz: '0380a6595e75211e561d48f82a5aff9a17dbb784fbc1cf3d1461fc75c140aae5f4e725b6154a50350e0213a99ae37483b502dc5d9409ce5d4285cd8cb2578e3d'
7
+ data.tar.gz: 38982ba43ac0bf04b21d79f737edb66bcdcb5d24b16b73def7ec978f6856dfe1ad9f3e89a848fc001e0e926b769ab25acd238224790e10c30d06dce7240b8fe0
@@ -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.3'
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: 2016-08-24 00:00:00.000000000 Z
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.6.7
74
+ rubygems_version: 2.5.2
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Formato y validacion de RUT Chileno