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.
- checksums.yaml +4 -4
- data/lib/chilean_rut.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9ae129e42335d59f3bc5d5df28aca797b929fd6
|
4
|
+
data.tar.gz: 8d6ea2b1b15a84f8e66f0881aa619c5e69f7764b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
74
|
+
rubygems_version: 2.6.7
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Formato y validacion de RUT Chileno
|