currency_quote 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +51 -0
- data/Gemfile.lock +1 -1
- data/README.md +44 -2
- data/lib/currency_quote/currency.rb +1 -1
- data/lib/currency_quote/dolar.rb +2 -2
- data/lib/currency_quote/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ae43131b099eed65bb04af747c645194237d2381e164578d663a40407d11f52
|
4
|
+
data.tar.gz: 96a40a3cfd66b9a649bc5dcdee633a54fb89a6f41497ee6ccd0065a5a3048a3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7d4da86ee07d734c03813c288bcdeabff2d948b8fb8a0a56d0263a0bfba2b73e27b3ae38adaf3f1725cb2db0c4ce84735830225017d52c1f03c1100bd8601bc
|
7
|
+
data.tar.gz: 7b76091240025a5af2eef158fe6a691d34503feeb50db249ab369e5d6cc805f62d6d17b3af2f5d3754207641b6b1500b6aedd4ceb4eec7899268913276238617
|
data/.gitignore
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
/.bundle/
|
2
3
|
/.yardoc
|
3
4
|
/_yardoc/
|
@@ -9,3 +10,53 @@
|
|
9
10
|
|
10
11
|
# rspec failure tracking
|
11
12
|
.rspec_status
|
13
|
+
# These are some examples of commonly ignored file patterns.
|
14
|
+
# You should customize this list as applicable to your project.
|
15
|
+
# Learn more about .gitignore:
|
16
|
+
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
|
17
|
+
|
18
|
+
# Node artifact files
|
19
|
+
node_modules/
|
20
|
+
dist/
|
21
|
+
|
22
|
+
# Compiled Java class files
|
23
|
+
*.class
|
24
|
+
|
25
|
+
# Compiled Python bytecode
|
26
|
+
*.py[cod]
|
27
|
+
|
28
|
+
# Log files
|
29
|
+
*.log
|
30
|
+
|
31
|
+
# Package files
|
32
|
+
*.jar
|
33
|
+
|
34
|
+
# Maven
|
35
|
+
target/
|
36
|
+
dist/
|
37
|
+
|
38
|
+
# JetBrains IDE
|
39
|
+
.idea/
|
40
|
+
|
41
|
+
# Unit test reports
|
42
|
+
TEST*.xml
|
43
|
+
|
44
|
+
# Generated by MacOS
|
45
|
+
.DS_Store
|
46
|
+
|
47
|
+
# Generated by Windows
|
48
|
+
Thumbs.db
|
49
|
+
|
50
|
+
# Applications
|
51
|
+
*.app
|
52
|
+
*.exe
|
53
|
+
*.war
|
54
|
+
|
55
|
+
# Large media files
|
56
|
+
*.mp4
|
57
|
+
*.tiff
|
58
|
+
*.avi
|
59
|
+
*.flv
|
60
|
+
*.mov
|
61
|
+
*.wmv
|
62
|
+
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -22,8 +22,50 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
### Cotizaciones disponibles
|
26
|
+
Bolívar Venezolano,
|
27
|
+
Cordoba Nicaraguense,
|
28
|
+
Corona Checa,
|
29
|
+
Corona Danesa,
|
30
|
+
Corona Noruega,
|
31
|
+
Corona Sueca,
|
32
|
+
Derecho Especial de Giro,
|
33
|
+
Dinar Serbia,
|
34
|
+
Dolar Australiano,
|
35
|
+
Dolar Canadiense,
|
36
|
+
Dolar de Singapur,
|
37
|
+
Dolar Estadounidense,
|
38
|
+
Dolar Hong Kong,
|
39
|
+
Dolar Neozelandes,
|
40
|
+
Euro (Unidad Monetaria Europe,
|
41
|
+
Florin (Antillas Holandesas),
|
42
|
+
Franco Suizo,
|
43
|
+
Guaraní Paraguayo,
|
44
|
+
Libra Esterlina,
|
45
|
+
Lira Turca,
|
46
|
+
Nuevo Sol Peruano,
|
47
|
+
Oro - Onza Troy,
|
48
|
+
Peso,
|
49
|
+
Peso Boliviano,
|
50
|
+
Peso Chileno,
|
51
|
+
Peso Colombiano,
|
52
|
+
Peso Mexicano,
|
53
|
+
Peso Uruguayo,
|
54
|
+
Plata - Onza Troy,
|
55
|
+
Rand Sudafricano,
|
56
|
+
Real (Brasil),
|
57
|
+
Rublo (Rusia),
|
58
|
+
Rupia (India),
|
59
|
+
Shekel (Israel),
|
60
|
+
Yen (Japón),
|
61
|
+
Yuan- China CNY,
|
62
|
+
Yuan-China Off Shore CNH
|
63
|
+
|
64
|
+
### Obtener cotización
|
65
|
+
quotation = CurrencyQuote::Currency.new(currency: "Peso Colombiano", date: "13/11/2020").get_quotation
|
66
|
+
|
67
|
+
Devuelve
|
68
|
+
$ #<struct Struct::Currency currency="Peso Colombiano", date="13/11/2020", sell=0.023289999999999998, buy=0.021646>
|
27
69
|
## Development
|
28
70
|
|
29
71
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/currency_quote/dolar.rb
CHANGED
@@ -33,14 +33,14 @@ class CurrencyQuote::Dolar
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def extract_data
|
36
|
-
|
36
|
+
data = @doc.css("td").map(&:text)
|
37
37
|
@date = data[data.size - 1]
|
38
38
|
@sell = data[data.size - 2].to_f
|
39
39
|
@buy = data[data.size - 3].to_f
|
40
40
|
end
|
41
41
|
|
42
42
|
def struct
|
43
|
-
s = Struct.new(
|
43
|
+
s = Struct.new(:date, :sell, :buy)
|
44
44
|
s.new(date, sell, buy)
|
45
45
|
end
|
46
46
|
end
|