ci_uy 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ci_uy.rb +3 -3
- metadata +2 -2
data/lib/ci_uy.rb
CHANGED
@@ -4,14 +4,14 @@ module CiUY
|
|
4
4
|
ci = '0' + ci if ci.size == 6
|
5
5
|
a = 0
|
6
6
|
(0..6).each do |i|
|
7
|
-
a += ("2987634"[i].
|
7
|
+
a += ("2987634"[i].to_i * ci[i].to_i)
|
8
8
|
end
|
9
|
-
(10 - (a % 10)).to_s[-1]
|
9
|
+
(10 - (a % 10)).to_s[-1]
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.validate_ci(ci)
|
13
13
|
ci = transform(ci)
|
14
|
-
dig = ci[-1]
|
14
|
+
dig = ci[-1]
|
15
15
|
ci = ci[0..-2]
|
16
16
|
self.get_validation_digit(ci) == dig
|
17
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci_uy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|