arbolito 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39c67c7fc0b5d92aee360462456aa02a90b725f8
4
- data.tar.gz: 970cdd3e45248a88523809ecdfc61437d6055f95
3
+ metadata.gz: 5eb7debcbbd8a4e8ae2a6affe9388c18be6d639c
4
+ data.tar.gz: eb4c652aab767c46cd192c4f644949c37327cd8e
5
5
  SHA512:
6
- metadata.gz: 369cd395a3c52d0b20b17e8578e6460a37b3487eec8f6a6434842ab8abfbfefc6505aa7a3a649f316263fd8b3cb72a350b72902ec2ee4d2b3c3d0d430c912617
7
- data.tar.gz: aea0d2c5fad8944d11ad826815b7cf435cba0f4d1acd442129d77e3e68f4bc42da38be6d9a213e8a4c2305b6284b8aa6f01b5e717e23673becd32aa85c81171a
6
+ metadata.gz: 9fd9267d12fff2f7ccbe2bb028bcf224f2bae6f8c544ead62812d08a84bbdf0b8d24869f7fce02e3beca6a721f21e931faba513b0f2470dc2d9755caa79dd9ba
7
+ data.tar.gz: 1ecae9413826f55e8173685047e4bc8749ddc632ff0b61735aff3952f83de48c6453309ce6e675e9422c9f3530bd9e41d2e3f07386d77d0b45759f4dbdd79b9c
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.email = ["contact@jonvillage.com"]
11
11
 
12
12
  s.summary = "A currency conversion api for the minimalist developer"
13
- s.description = s.summary
13
+ s.description = "A currency conversion that fetch from external source and also let's you add a fixed rate for different currencies"
14
14
  s.homepage = "https://github.com/jvillarejo/arbolito.git"
15
15
  s.license = "MIT"
16
16
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -3,37 +3,37 @@ require 'net/http'
3
3
  module Arbolito
4
4
  module Exchange
5
5
  class YahooFinance
6
- def initialize(api_key = '')
7
- end
8
- # DEPRECATED Yahoo Finance is not supported anymore by Yahoo so use Alpha Vantage API
9
- def find_current_rate(quote)
10
- warn "[DEPRECATION] Yahoo Finance `find_current_rate` is deprecated. Please use AlphaVantage `find_current_rate` instead."
11
- data = response(build_uri(quote))
6
+ class << self
7
+ # DEPRECATED Yahoo Finance is not supported anymore by Yahoo so use Alpha Vantage API
8
+ def find_current_rate(quote)
9
+ warn "[DEPRECATION] Yahoo Finance `find_current_rate` is deprecated. Please use AlphaVantage `find_current_rate` instead."
10
+ data = response(build_uri(quote))
12
11
 
13
- values = {
14
- quote: quote,
15
- price: data[1],
16
- }
12
+ values = {
13
+ quote: quote,
14
+ price: data[1],
15
+ }
17
16
 
18
- build_rate(values)
19
- end
17
+ build_rate(values)
18
+ end
20
19
 
21
- private
22
- def response(uri)
23
- response = Net::HTTP.get(uri)
24
- data = response.gsub(/"|\\n/,'').split(',')
25
- end
20
+ private
21
+ def response(uri)
22
+ response = Net::HTTP.get(uri)
23
+ data = response.gsub(/"|\\n/,'').split(',')
24
+ end
26
25
 
27
- def build_uri(quote)
28
- param = "#{quote.from.upcase}#{quote.to.upcase}"
29
- URI("http://download.finance.yahoo.com/d/quotes.csv?s=#{param}=X&f=nl1d1t1")
30
- end
26
+ def build_uri(quote)
27
+ param = "#{quote.from.upcase}#{quote.to.upcase}"
28
+ URI("http://download.finance.yahoo.com/d/quotes.csv?s=#{param}=X&f=nl1d1t1")
29
+ end
31
30
 
32
- def build_rate(values)
33
- Currency::Rate.new(
34
- values[:price],
35
- values[:quote].to_hash
36
- )
31
+ def build_rate(values)
32
+ Currency::Rate.new(
33
+ values[:price],
34
+ values[:quote].to_hash
35
+ )
36
+ end
37
37
  end
38
38
  end
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module Arbolito
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arbolito
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jvillarejo
@@ -66,7 +66,8 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.10'
69
- description: A currency conversion api for the minimalist developer
69
+ description: A currency conversion that fetch from external source and also let's
70
+ you add a fixed rate for different currencies
70
71
  email:
71
72
  - contact@jonvillage.com
72
73
  executables: []