coingecko_ruby 0.4.1 → 0.4.2

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
  SHA256:
3
- metadata.gz: 1c8984aded5deb18ae9a254963220c6eeec5c16a604fe8547da2ee07c5f22791
4
- data.tar.gz: b35147679c0964fdc925c027a07c134fccfb692edb67017949146a38cbe26a5b
3
+ metadata.gz: e7bba257d165b4feee8f9680aabd6a49b93c14ca20ae1058dbb4dae9faefab80
4
+ data.tar.gz: 7f7134bf41da5c9c7204f357d7e72129af030cf576a22c9e7726bd792e1f17f8
5
5
  SHA512:
6
- metadata.gz: 9807f40015c3cbca8f485041cde2f531efdcdbbb970687db048b7fd09e7545f5dad94899a93ed887dd481d17ce759d765e9fc654c4c1a5baa287b530edbf92f1
7
- data.tar.gz: 40ae798ecc46325e8103ffb0a20fd60757f6e26acf55ae527f7041f5d2a345b2020ecccb3daafdaf1d7848c8e137613891c8fb067bb4f91a68d95cac4d308450
6
+ metadata.gz: f4471834f358adbbcbc50774f0a2260ca5e1eccc557fd8f6d6a116efd9e799dd64a76d7b013d6e4cecb60b833d8e23d9903f6db085547f7f3884805517141623
7
+ data.tar.gz: 33a2d52f07e93c10b5291df1fe170d1b1dc61432f0105fdeb385f9f043d50b2fe15254d374c7582655bd4d573ad3f4cc3054edb3906bd12724e75582a73d05e0
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coingecko_ruby (0.4.1)
4
+ coingecko_ruby (0.4.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -8,8 +8,8 @@ CoingeckoRuby is an easy-to-use client/wrapper for CoinGecko's awesome cryptocur
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- ```ruby
12
- gem 'coingecko_ruby'
11
+ ```
12
+ gem 'coingecko_ruby'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -24,26 +24,26 @@ Or install it yourself as:
24
24
 
25
25
  1. Require the gem if you're not using Rails or if your environment does not autoload libraries.
26
26
 
27
- ```ruby
27
+ ```
28
28
  require 'coingecko_ruby'
29
29
  ```
30
30
 
31
31
  2. Create a client instance.
32
32
 
33
- ```ruby
33
+ ```
34
34
  client = CoingeckoRuby::Client.new
35
35
  ```
36
36
 
37
37
  3. Use the client to fetch your desired data.
38
38
 
39
- ```ruby
39
+ ```
40
40
  # Example: Fetching the current price of Bitcoin.
41
41
  client.price('bitcoin')
42
42
  ```
43
43
 
44
44
  ## Documentation
45
45
 
46
- [Read the API documentation here: ](https://julianfssen.github.io/coingecko_ruby/CoingeckoRuby.html)
46
+ [Read the API documentation here: ](https://rubydoc.info/gems/coingecko_ruby)
47
47
 
48
48
  ## Contributing
49
49
 
@@ -22,7 +22,7 @@ module CoingeckoRuby
22
22
  # }, {
23
23
  # ]
24
24
  def coins_list(**options)
25
- get 'coins/list', options
25
+ get 'coins/list', **options
26
26
  end
27
27
 
28
28
  # Fetches detailed current data for a coin.
@@ -38,7 +38,7 @@ module CoingeckoRuby
38
38
  # @example Fetch Bitcoin's current data.
39
39
  # client.coin('bitcoin')
40
40
  def coin(id, **options)
41
- get "coins/#{id}", options
41
+ get "coins/#{id}", **options
42
42
  end
43
43
 
44
44
  # @deprecated Use {#coin} instead
@@ -128,7 +128,7 @@ module CoingeckoRuby
128
128
  # }],
129
129
  # }
130
130
  def tickers(id, **options)
131
- get "coins/#{id}/tickers", options
131
+ get "coins/#{id}/tickers", **options
132
132
  end
133
133
 
134
134
  # @deprecated Use {#tickers} instead
@@ -216,7 +216,7 @@ module CoingeckoRuby
216
216
  # }
217
217
  # ]
218
218
  def markets(ids, **options)
219
- get 'coins/markets', { ids: ids, **options }
219
+ get 'coins/markets', ids: ids, **options
220
220
  end
221
221
 
222
222
  # @deprecated Use {#markets} instead
@@ -45,7 +45,7 @@ module CoingeckoRuby
45
45
  # },
46
46
  # ]
47
47
  def derivatives(**options)
48
- get 'derivatives', options
48
+ get 'derivatives', **options
49
49
  end
50
50
 
51
51
  # @deprecated Use {#derivatives} instead
@@ -79,7 +79,7 @@ module CoingeckoRuby
79
79
  # "url" => "https://www.binance.com/"
80
80
  # }]
81
81
  def derivative_exchanges(**options)
82
- get 'derivatives/exchanges', options
82
+ get 'derivatives/exchanges', **options
83
83
  end
84
84
 
85
85
  # @deprecated Use {#derivative_exchanges} instead
@@ -112,7 +112,7 @@ module CoingeckoRuby
112
112
  # "url" => "https://www.binance.com/"
113
113
  # }
114
114
  def derivative_exchange(id, **options)
115
- get "derivatives/exchanges/#{id}", options
115
+ get "derivatives/exchanges/#{id}", **options
116
116
  end
117
117
 
118
118
  # @deprecated Use {#derivative_exchange} instead
@@ -16,7 +16,7 @@ module CoingeckoRuby
16
16
  # @example Get all upcoming events.
17
17
  # client.events(upcoming_events_only: true)
18
18
  def events(**options)
19
- get 'events', options
19
+ get 'events', **options
20
20
  end
21
21
 
22
22
  # @deprecated Use {#events} instead
@@ -26,7 +26,7 @@ module CoingeckoRuby
26
26
  # "trade_volume_24h_btc_normalized" => 982949.3975723931
27
27
  # }]
28
28
  def exchanges(**options)
29
- get 'exchanges', options
29
+ get 'exchanges', **options
30
30
  end
31
31
 
32
32
  # @deprecated Use {#exchanges} instead
@@ -121,7 +121,7 @@ module CoingeckoRuby
121
121
  # }]
122
122
  # }
123
123
  def exchange_tickers(id, **options)
124
- get "exchanges/#{id}/tickers", options
124
+ get "exchanges/#{id}/tickers", **options
125
125
  end
126
126
 
127
127
  # @deprecated Use {#exchange_tickers} instead
@@ -157,7 +157,7 @@ module CoingeckoRuby
157
157
  # }]
158
158
  # }
159
159
  def exchange_status(id, **options)
160
- get "exchanges/#{id}/status_updates", options
160
+ get "exchanges/#{id}/status_updates", **options
161
161
  end
162
162
 
163
163
  # @deprecated Use {#exchange_status} instead
@@ -181,7 +181,7 @@ module CoingeckoRuby
181
181
  # [1620557400000.0, "1042158.4333253484568599192332614201045319574863305612009609211497295171074087677404153278624"]
182
182
  # ]
183
183
  def exchange_volume(id, days: 7, **options)
184
- get "exchanges/#{id}/volume_chart", { days: days, **options }
184
+ get "exchanges/#{id}/volume_chart", days: days, **options
185
185
  end
186
186
 
187
187
  # @deprecated Use {#exchange_volume} instead
@@ -35,7 +35,7 @@ module CoingeckoRuby
35
35
  # }
36
36
  # ]
37
37
  def finance_platforms(**options)
38
- get 'finance_platforms', options
38
+ get 'finance_platforms', **options
39
39
  end
40
40
 
41
41
  # @deprecated Use {#finance_platforms} instead
@@ -88,7 +88,7 @@ module CoingeckoRuby
88
88
  # "redeem_at"=>0}
89
89
  # ]
90
90
  def finance_products(**options)
91
- get 'finance_products', options
91
+ get 'finance_products', **options
92
92
  end
93
93
 
94
94
  # @deprecated Use {#finance_products} instead
@@ -29,7 +29,7 @@ module CoingeckoRuby
29
29
  # "is_multi_asset_composite"=>false}
30
30
  # ]
31
31
  def indexes(**options)
32
- get 'indexes', options
32
+ get 'indexes', **options
33
33
  end
34
34
 
35
35
  # @deprecated Use {#indexes} instead
@@ -76,7 +76,7 @@ module CoingeckoRuby
76
76
  # "is_multi_asset_composite"=>false
77
77
  # }
78
78
  def indexes_by_market_and_coin(market_id, coin_id, **options)
79
- get "indexes/#{market_id}/#{coin_id}", options
79
+ get "indexes/#{market_id}/#{coin_id}", **options
80
80
  end
81
81
 
82
82
  # @deprecated Use {#indexes_by_market_and_coin} instead
@@ -163,7 +163,7 @@ module CoingeckoRuby
163
163
  # }]
164
164
  # }
165
165
  def status_updates(**options)
166
- get 'status_updates', options
166
+ get 'status_updates', **options
167
167
  end
168
168
 
169
169
  def get_status_updates(options: {})
@@ -34,7 +34,7 @@ module CoingeckoRuby
34
34
  def price(ids, currency: 'usd', **options)
35
35
  ids = ids.join(',') if ids.is_a? Array
36
36
  currency = currency.join(',') if currency.is_a? Array
37
- get 'simple/price', { ids: ids, vs_currencies: currency, **options }
37
+ get 'simple/price', ids: ids, vs_currencies: currency, **options
38
38
  end
39
39
 
40
40
  # @see Alias for {#price}
@@ -122,7 +122,7 @@ module CoingeckoRuby
122
122
  def historical_price(id, date:, **options)
123
123
  date = Time.now.strftime('%d-%m-%Y') if date.nil?
124
124
 
125
- get "coins/#{id}/history", { date: date, **options }
125
+ get "coins/#{id}/history", date: date, **options
126
126
  end
127
127
 
128
128
  # @deprecated Use {#historical_price} instead
@@ -158,7 +158,7 @@ module CoingeckoRuby
158
158
  # ]
159
159
  # }
160
160
  def minutely_historical_price(id, currency: 'usd', **options)
161
- get "coins/#{id}/market_chart", { vs_currency: currency, days: 1, **options }
161
+ get "coins/#{id}/market_chart", vs_currency: currency, days: 1, **options
162
162
  end
163
163
 
164
164
  # @deprecated Use {#minutely_historical_price} instead
@@ -195,7 +195,7 @@ module CoingeckoRuby
195
195
  def hourly_historical_price(id, currency: 'usd', days: 7, **options)
196
196
  return daily_historical_price(id, currrency: currency, days: days) if days > 90
197
197
 
198
- get "coins/#{id}/market_chart", { vs_currency: currency, days: days, **options }
198
+ get "coins/#{id}/market_chart", vs_currency: currency, days: days, **options
199
199
  end
200
200
 
201
201
  # @deprecated Use {#hourly_historical_price} instead
@@ -229,7 +229,7 @@ module CoingeckoRuby
229
229
  # ]
230
230
  # }
231
231
  def daily_historical_price(id, currency: 'usd', days: 7, **options)
232
- get "coins/#{id}/market_chart", { vs_currency: currency, days: days, interval: 'daily', **options }
232
+ get "coins/#{id}/market_chart", vs_currency: currency, days: days, interval: 'daily', **options
233
233
  end
234
234
 
235
235
  # @deprecated Use {#daily_historical_price} instead
@@ -256,7 +256,7 @@ module CoingeckoRuby
256
256
  # [1620576000000, 57956.7, 57956.7, 56636.68, 57302.22],
257
257
  # ]
258
258
  def ohlc(id, currency: 'usd', days: 7, **options)
259
- get "coins/#{id}/ohlc", { vs_currency: currency, days: days, **options }
259
+ get "coins/#{id}/ohlc", vs_currency: currency, days: days, **options
260
260
  end
261
261
 
262
262
  # @deprecated Use {#ohlc} instead
@@ -6,7 +6,7 @@ module CoingeckoRuby
6
6
  module Connection
7
7
  BASE_URL = 'https://api.coingecko.com/api/v3/'.freeze
8
8
 
9
- def get(endpoint, params = {}, **options)
9
+ def get(endpoint, **params)
10
10
  url = BASE_URL + endpoint
11
11
  uri = URI(url)
12
12
  uri = build_request(uri, params) unless params.empty?
@@ -1,3 +1,3 @@
1
1
  module CoingeckoRuby
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coingecko_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Foo Siang Sen
@@ -20,6 +20,7 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - ".github/workflows/ruby.yml"
22
22
  - ".gitignore"
23
+ - ".ruby-version"
23
24
  - ".travis.yml"
24
25
  - CHANGELOG.md
25
26
  - Gemfile