Class: BlockchainInfo::Exchange

Inherits:
Ressource show all
Defined in:
lib/exchange.rb

Class Method Summary collapse

Class Method Details

.tickerObject

Returns a JSON object with the currency codes as keys. “15m” is the 15 minutes delayed market price, “24h” is the 24 hour average market price, “symbol” is the currency symbol.

"GBP" : {"last" : 22.9525, "buy" : 22.83201, "sell" : 23.0, "24h" : 23.1, "symbol" : "£",
"EUR" : : 26.32999, "buy" : 26.33, "sell" : 26.81774, "24h" : 26.7, "symbol" : "€",
...

}



10
11
12
# File 'lib/exchange.rb', line 10

def self.ticker
  query('ticker')
end

.to_btc(currency, value) ⇒ Object

Returns the value in BTC.



15
16
17
# File 'lib/exchange.rb', line 15

def self.to_btc currency, value
  query('tobtc', { currency: currency, value: value })
end