uni 0.0.3 → 0.0.4
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 +8 -8
- data/lib/uni/public_info.rb +12 -2
- data/lib/uni/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGY4M2MxNGVkODA0NDhiZDgyYjUxYWUxMmYzY2M2N2FlY2JmODRjOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGJlM2E4M2RiOTZiY2M4OTEzMDc5MjlkYWZhNzg2MWQ4ZDg4NzM4ZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDNkMTg1YTE2MWJhN2NmNzQ4YWYwZmE5OTEwNDg4YzI4MTEwNDhhNDI1YjJi
|
10
|
+
MDBmMmI5OGI2ODVhYzhlYjg5OTRiZjhkMGZmNWM3M2U3ZDMyYTdmZWU4ODQ4
|
11
|
+
Nzg5MzM4ZGIwZjVkODYyODgzNjI3ZGQzNDhkMzk3Zjg2NDg3NjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTAzZDg0ZjE4NjQwOGJkNTU3NDYxNjY5M2E0MzQxODZmNGYyZGI5NDczZWVk
|
14
|
+
NmM5MmE0MDllY2EzYTEwOWMyYTgwMTg0MDQ1MTMzYjdiZmNlMTliYWZkYjEz
|
15
|
+
ZTQ0ODc3NGJiYWRmNGM0MzRlMGU5ZmNhZDQ2ZmM4YjkwMzBmNWY=
|
data/lib/uni/public_info.rb
CHANGED
@@ -8,6 +8,7 @@ module Uni
|
|
8
8
|
SITUACION = SITUACIONX + SITUACIONY
|
9
9
|
@x, @y = {}, {}
|
10
10
|
@base = Mechanize.new
|
11
|
+
# Inicializa las constantes @x y @y
|
11
12
|
def self.initialize
|
12
13
|
(1900..2014).each do |n|
|
13
14
|
tmp, v, ans = n, 2123, 0
|
@@ -28,11 +29,17 @@ module Uni
|
|
28
29
|
@y[n] = ans
|
29
30
|
end
|
30
31
|
end
|
31
|
-
|
32
|
+
# Obtiene letra de codigo (mas rapido que la implementacion #codigo_uni)
|
33
|
+
# @see #codigo_uni
|
34
|
+
# @param n [Fixnum] Un objeto Fixnum
|
35
|
+
# @return [String] El codigo con su respectiva letra
|
32
36
|
def self.fast_uni n
|
33
37
|
n.to_s + (65 + (@x[n/10000] + @y[n%10000])%11).chr
|
34
38
|
end
|
35
|
-
|
39
|
+
# Obtiene letra de codigo
|
40
|
+
# @see #fast_uni
|
41
|
+
# @param n [Fixnum] Un objeto Fixnum
|
42
|
+
# @return [String] El codigo con su respectiva letra
|
36
43
|
def self.codigo_uni n
|
37
44
|
codigo = n.to_s
|
38
45
|
v, ans = 21234567, 0
|
@@ -43,6 +50,9 @@ module Uni
|
|
43
50
|
end
|
44
51
|
codigo + (65 + ans%11).chr
|
45
52
|
end
|
53
|
+
# Obtiene informacion publica de un alumno
|
54
|
+
# @param codigo [String] Un objeto String, que representa el codigo de un estudiante
|
55
|
+
# @return [Hash] Informacion publica obtenida de la Orce
|
46
56
|
|
47
57
|
def self.data codigo
|
48
58
|
agent = @base
|
data/lib/uni/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uni
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Pando
|
@@ -94,3 +94,4 @@ signing_key:
|
|
94
94
|
specification_version: 4
|
95
95
|
summary: Libreria en Ruby para obtener informacion basica de la Orce-Uni
|
96
96
|
test_files: []
|
97
|
+
has_rdoc:
|