chilean_rut 0.2 → 0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chilean_rut.rb +15 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 022c6440fefaaa336e005865a7970c4d96fcedec
4
- data.tar.gz: d1c90f9a28a7acdc23ee34a4e03fdb88e340494f
3
+ metadata.gz: b9ae129e42335d59f3bc5d5df28aca797b929fd6
4
+ data.tar.gz: 8d6ea2b1b15a84f8e66f0881aa619c5e69f7764b
5
5
  SHA512:
6
- metadata.gz: 621d9df78166cc88081ec89ff87d0aba4d362628a5fec8000e2474e5a7827aece0509c936df6d9650a560c689bf9f6b16e59b920914eb27e1327832d44bddcd4
7
- data.tar.gz: d24f91336346c5e48051a2ca22af53b1ab5fb682296d5a386d4098c7ce844d2b17c5d96d7d5e3543c999827172b3436543cbe0b34f82f7b5ef9f51afc271797a
6
+ metadata.gz: 51932f9658d3a847c7c2da715d4b2c2814abe2d2760958168f1450d030d5aa507ad03600692972bcc878754988fc6a42bf0d5769ae8d71d3861c5749b75967bc
7
+ data.tar.gz: 74ff268e20956a93d7e8b8b318807ad10cc5283914ff8d399d733c722a736515a82dd68f1f89cb522cad8dc4a4c241aa2d3a20e5b594efe8f417b9de440a3aab
data/lib/chilean_rut.rb CHANGED
@@ -124,4 +124,19 @@ class RUT
124
124
  return rut.upcase
125
125
  end
126
126
 
127
+ ##
128
+ #This method will give a raw R.U.T. string this method returns boolean wether it no is valid or a hash if string is a valid rut
129
+ def self.get_rut_and_dv(rut)
130
+ unless self.validate(rut)
131
+ return false
132
+ end
133
+
134
+ rut = self.format(rut).split("-")
135
+
136
+ out = {
137
+ :rut => rut.first.delete("."),
138
+ :dv => rut.last
139
+ }
140
+ end
141
+
127
142
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chilean_rut
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo
@@ -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.6
74
+ rubygems_version: 2.6.7
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Formato y validacion de RUT Chileno