crypto_converter 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 +4 -4
- data/lib/crypto_converter/converter.rb +5 -1
- data/lib/crypto_converter.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d21fdf18400faeecd4d0dca1474fd2e7745033d
|
4
|
+
data.tar.gz: 09b75a1ef8cba5def5cf3af8c9ed3b72d5e3114f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a11db4605331a0bb902a78727a3c6026cd1e612c2343ebebe2ac8a64fa786ee03e6790b4771b24d4e33368fb1bb31630cc2bcc7486637a86fc7fd9283cb2837a
|
7
|
+
data.tar.gz: cd5f8f389c0749baeae8172d70d854a17b176561c4a0f32c67c3ebd6b44b022d64862835a9263edadc0c7caffb2dc9ef41cb9c4c5805cb4de7ff0a5cb2023409
|
@@ -13,7 +13,11 @@ class Converter
|
|
13
13
|
|
14
14
|
def refresh
|
15
15
|
uri = URI.parse(@currencies_path)
|
16
|
-
|
16
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
17
|
+
http.use_ssl = true
|
18
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
19
|
+
response = http.request(request)
|
20
|
+
|
17
21
|
@currencies_json = JSON.parse(response)
|
18
22
|
end
|
19
23
|
|
data/lib/crypto_converter.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'crypto_converter/converter'
|
2
2
|
|
3
3
|
class CryptoConverter
|
4
|
-
def self.init(current_currency, targeted_currency, currencies_path = "
|
4
|
+
def self.init(current_currency, targeted_currency, currencies_path = "https://www.getsaascoin.com/api/v1/currencies")
|
5
5
|
@converter = Converter.new(current_currency, targeted_currency, currencies_path)
|
6
6
|
end
|
7
7
|
end
|