currency-rate 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/currency-rate.gemspec +4 -6
  4. data/lib/adapter.rb +36 -4
  5. data/lib/btc_adapters/average_rate_adapter.rb +2 -0
  6. data/lib/btc_adapters/bitfinex_adapter.rb +9 -0
  7. data/lib/btc_adapters/bitpay_adapter.rb +9 -2
  8. data/lib/btc_adapters/bitstamp_adapter.rb +9 -1
  9. data/lib/btc_adapters/btcchina_adapter.rb +5 -1
  10. data/lib/btc_adapters/btce_adapter.rb +9 -1
  11. data/lib/btc_adapters/coinbase_adapter.rb +9 -0
  12. data/lib/btc_adapters/huobi_adapter.rb +9 -0
  13. data/lib/btc_adapters/kraken_adapter.rb +9 -0
  14. data/lib/btc_adapters/localbitcoins_adapter.rb +9 -0
  15. data/lib/btc_adapters/okcoin_adapter.rb +9 -0
  16. data/lib/currency_rate.rb +6 -1
  17. data/lib/fiat_adapters/fixer_adapter.rb +11 -0
  18. data/lib/fiat_adapters/yahoo_adapter.rb +8 -0
  19. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/average_rate_adapter.yml +307 -281
  20. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/bitfinex_adapter.yml +46 -50
  21. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/bitpay_adapter.yml +272 -0
  22. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/btcchina_adapter.yml +9 -8
  23. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/btce_adapter.yml +30 -30
  24. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/coinbase_adapter.yml +36 -16
  25. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/huobi_adapter.yml +20 -20
  26. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/kraken_adapter.yml +12 -12
  27. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/localbitcoins_adapter.yml +88 -83
  28. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/okcoin_adapter.yml +52 -36
  29. data/spec/fixtures/vcr/exchange_rate_adapters/fiat_adapters/fixer_adapter.yml +16 -12
  30. data/spec/fixtures/vcr/exchange_rate_adapters/fiat_adapters/yahoo_adapter.yml +9 -11
  31. data/spec/lib/btc_adapter_spec.rb +12 -1
  32. data/spec/lib/btc_adapters/average_rate_adapter_spec.rb +1 -6
  33. data/spec/lib/btc_adapters/bitfinex_adapter_spec.rb +6 -6
  34. data/spec/lib/btc_adapters/bitpay_adapter_spec.rb +5 -5
  35. data/spec/lib/btc_adapters/bitstamp_adapter_spec.rb +9 -9
  36. data/spec/lib/btc_adapters/btcchina_adapter_spec.rb +4 -4
  37. data/spec/lib/btc_adapters/btce_adapter_spec.rb +10 -10
  38. data/spec/lib/btc_adapters/coinbase_adapter_spec.rb +4 -4
  39. data/spec/lib/btc_adapters/huobi_adapter_spec.rb +6 -6
  40. data/spec/lib/btc_adapters/kraken_adapter_spec.rb +6 -6
  41. data/spec/lib/btc_adapters/localbitcoins_adapter_spec.rb +4 -4
  42. data/spec/lib/btc_adapters/okcoin_adapter_spec.rb +11 -11
  43. data/spec/lib/fiat_adapters/fixer_adapter_spec.rb +5 -5
  44. data/spec/lib/fiat_adapters/yahoo_adapter_spec.rb +5 -5
  45. metadata +3 -4
  46. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/bitpay_adapter_yml.yml +0 -272
  47. data/spec/fixtures/vcr/exchange_rate_adapters/btc_adapters/bitstamp_adapter.yml +0 -153
@@ -1,153 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://www.bitstamp.net/api/v2/ticker/btcusd/
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept-Encoding:
11
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
- Accept:
13
- - "*/*"
14
- User-Agent:
15
- - Ruby
16
- response:
17
- status:
18
- code: 200
19
- message: OK
20
- headers:
21
- Etag:
22
- - '"6294c-c6-5358c763fe1e1"'
23
- Last-Modified:
24
- - Sat, 18 Jun 2016 12:17:59 GMT
25
- Content-Type:
26
- - application/json
27
- Content-Length:
28
- - '142'
29
- Connection:
30
- - keep-alive
31
- Cache-Control:
32
- - max-age=10, public
33
- Expires:
34
- - Sat, 18 Jun 2016 12:18:22 GMT
35
- Date:
36
- - Sat, 18 Jun 2016 12:18:12 GMT
37
- Set-Cookie:
38
- - incap_ses_220_99025=wQfzfpFG+Eq6yG7FOqINAwQ8ZVcAAAAA2IIq95EXi1XBrD3laKUZ+A==;
39
- path=/; Domain=.bitstamp.net
40
- - visid_incap_99025=wweiKoT2RWWFdobKK3cf4wQ8ZVcAAAAAQUIPAAAAAADnH3BD8BCXGU0F8hWrQTXg;
41
- expires=Sun, 18 Jun 2017 07:26:36 GMT; path=/; Domain=.bitstamp.net
42
- X-Iinfo:
43
- - 9-56714738-0 0CNN RT(1466252292066 592) q(0 -1 -1 -1) r(0 -1)
44
- X-Cdn:
45
- - Incapsula
46
- body:
47
- encoding: ASCII-8BIT
48
- string: '{"high": "757.96000", "last": "751.97000", "timestamp": "1466252278",
49
- "bid": "751.47000", "vwap": "745.36091", "volume": "6901.58275229", "low":
50
- "723.02000", "ask": "751.97000", "open": "745.00000"}'
51
- http_version:
52
- recorded_at: Sat, 18 Jun 2016 12:18:13 GMT
53
- - request:
54
- method: get
55
- uri: https://www.bitstamp.net/api/v2/ticker/btceur/
56
- body:
57
- encoding: US-ASCII
58
- string: ''
59
- headers:
60
- Accept-Encoding:
61
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
62
- Accept:
63
- - "*/*"
64
- User-Agent:
65
- - Ruby
66
- response:
67
- status:
68
- code: 200
69
- message: OK
70
- headers:
71
- Etag:
72
- - '"62428-c6-5358c76731722"'
73
- Last-Modified:
74
- - Sat, 18 Jun 2016 12:18:02 GMT
75
- Content-Type:
76
- - application/json
77
- Content-Length:
78
- - '144'
79
- Connection:
80
- - keep-alive
81
- Cache-Control:
82
- - max-age=10, public
83
- Expires:
84
- - Sat, 18 Jun 2016 12:18:24 GMT
85
- Date:
86
- - Sat, 18 Jun 2016 12:18:14 GMT
87
- Set-Cookie:
88
- - incap_ses_220_99025=X4gkKY1GaAzZzG7FOqINAwY8ZVcAAAAA7sir6DswX0eW+RHQAZ3P2w==;
89
- path=/; Domain=.bitstamp.net
90
- - visid_incap_99025=1xi3KqDBRaC9elEeju7YyQY8ZVcAAAAAQUIPAAAAAAD5Hd7wQZNNpNjBCz4yMhvE;
91
- expires=Sun, 18 Jun 2017 07:26:36 GMT; path=/; Domain=.bitstamp.net
92
- X-Iinfo:
93
- - 9-56715209-0 0CNN RT(1466252293557 573) q(0 -1 -1 -1) r(0 -1)
94
- X-Cdn:
95
- - Incapsula
96
- body:
97
- encoding: ASCII-8BIT
98
- string: '{"high": "679.08000", "last": "674.50000", "timestamp": "1466252282",
99
- "bid": "670.67000", "vwap": "668.63961", "volume": "1356.06136004", "low":
100
- "659.34000", "ask": "674.50000", "open": "672.15000"}'
101
- http_version:
102
- recorded_at: Sat, 18 Jun 2016 12:18:15 GMT
103
- - request:
104
- method: get
105
- uri: https://www.bitstamp.net/api/v2/ticker/eurusd/
106
- body:
107
- encoding: US-ASCII
108
- string: ''
109
- headers:
110
- Accept-Encoding:
111
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
112
- Accept:
113
- - "*/*"
114
- User-Agent:
115
- - Ruby
116
- response:
117
- status:
118
- code: 200
119
- message: OK
120
- headers:
121
- Etag:
122
- - '"62a85-b6-5358c76799efe"'
123
- Last-Modified:
124
- - Sat, 18 Jun 2016 12:18:02 GMT
125
- Content-Type:
126
- - application/json
127
- Content-Length:
128
- - '135'
129
- Connection:
130
- - keep-alive
131
- Cache-Control:
132
- - max-age=10, public
133
- Expires:
134
- - Sat, 18 Jun 2016 12:18:25 GMT
135
- Date:
136
- - Sat, 18 Jun 2016 12:18:15 GMT
137
- Set-Cookie:
138
- - incap_ses_220_99025=wERdE34q4y7x0G7FOqINAwc8ZVcAAAAAPxSkhEAtIJ28pp8s9oRuiQ==;
139
- path=/; Domain=.bitstamp.net
140
- - visid_incap_99025=3suN8VjZRqKmkj5hkjOFVwc8ZVcAAAAAQUIPAAAAAAD6yyMULIf23R9y57+RIwUr;
141
- expires=Sun, 18 Jun 2017 07:26:36 GMT; path=/; Domain=.bitstamp.net
142
- X-Iinfo:
143
- - 9-56715632-0 0CNN RT(1466252295021 664) q(0 -1 -1 -1) r(0 -1)
144
- X-Cdn:
145
- - Incapsula
146
- body:
147
- encoding: ASCII-8BIT
148
- string: '{"high": "1.12350", "last": "1.11002", "timestamp": "1466252282", "bid":
149
- "1.11003", "vwap": "1.11349", "volume": "55451.55469", "low": "1.09500", "ask":
150
- "1.12496", "open": "1.11002"}'
151
- http_version:
152
- recorded_at: Sat, 18 Jun 2016 12:18:16 GMT
153
- recorded_with: VCR 3.0.3