Class: Utils
- Inherits:
-
Object
- Object
- Utils
- Defined in:
- lib/utils.rb
Class Method Summary collapse
Class Method Details
.get_bchxrp_price ⇒ Object
2 3 4 5 6 7 |
# File 'lib/utils.rb', line 2 def self.get_bchxrp_price # fetch bch/xrp price from coin market cap response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1831/?convert=XRP') hash = JSON.parse (response.body) return hash['data']['quotes']['XRP']['price'].to_f.round(4) end |