class BtcExchangeInfo::Maicoin
Public Class Methods
btc(type)
click to toggle source
# File lib/btc_exchange_info/maicoin.rb, line 4 def btc(type) response = download_ticker return nil if response.nil? response["#{type}_price"].to_f end
url()
click to toggle source
# File lib/btc_exchange_info/maicoin.rb, line 10 def url "https://api.maicoin.com" end
Private Class Methods
download_ticker()
click to toggle source
# File lib/btc_exchange_info/maicoin.rb, line 16 def download_ticker response = RestClient.get "#{url}/v1/prices/twd" data = JSON.parse(response.body) rescue nil end