ExchangeRateVlad 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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ExchangeRateVlad.rb +9 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c67d63c8a00370be0691812d32d5c911c50fd583
4
- data.tar.gz: 1925c35ba4cb3784da3b92b283b80b061053336f
3
+ metadata.gz: da6722b212da5695ab602ea392af418a7586f5ca
4
+ data.tar.gz: a97d374515681b588965d6198278da0f3892e43c
5
5
  SHA512:
6
- metadata.gz: fbd8f34144604cf5a7e473d21167192b255c73944aae83455dabbc5a0f08360f03c98d48a44c6ca070a2cd4b242db28f63b98dfcc19a8d9a8a0b4761b24617b8
7
- data.tar.gz: 6cbaf4953fb9bd6af5f704336f409d584b8814a1f6fc6f5acbd308f28078c2af7003104e77b26ed7f829239d3d548c307507be41ce35b133c47361ff83007957
6
+ metadata.gz: 9d0cc04ac5e62aafc055da909c67d91ed89b51ab2c616de461d6734a50f9a725e368f89a91f46ebf35bcaa109dea4faffd61d2e488614cd9564344aad9ff5c05
7
+ data.tar.gz: 0d0d7415a2ea3e5431bea86bfba7396a88de8d6c19e3586da53267e67dc7029e705c777f1501b020f62fbc4f130c4c264aca5cda381012d30d9cff60edca76a4
@@ -2,6 +2,7 @@ class Converter
2
2
  require 'nokogiri'
3
3
  @@doc
4
4
  @@currencies = ['EUR']
5
+ @@times
5
6
  def init(file)
6
7
  if file.start_with?('http://') || file.start_with?('https://')
7
8
  require 'open-uri'
@@ -29,6 +30,13 @@ class Converter
29
30
  @@currencies.push(x['currency'])
30
31
  end
31
32
  return @@currencies
33
+ end
34
+ def get_times()
35
+ c = @@doc.css('Cube Cube')
36
+ for x in c
37
+ @@times.push(x['time'])
38
+ end
39
+ return @@times
32
40
  end
33
41
  def at(date, c1, c2)
34
42
  d = date.strftime("%Y-%m-%d")
@@ -54,7 +62,7 @@ class Converter
54
62
  er2 = r.at_css('[@currency="'+c2+'"]')['rate'].to_f
55
63
  end
56
64
  rescue
57
- p 'Something is wrong witht this currency: ' + c2
65
+ p 'Something is wrong with this currency: ' + c2
58
66
  return -1
59
67
  end
60
68
  return er2/er1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ExchangeRateVlad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Otrocol