module Mintpal
Constants
- API_URL
- VALID_COINS
- VALID_EXCHANGES
- VERSION
Public Class Methods
market_chart_data()
click to toggle source
# File lib/mintpal_ruby.rb, line 51 def market_chart_data # end
market_orders()
click to toggle source
# File lib/mintpal_ruby.rb, line 47 def market_orders # end
market_stats(coin, exchange=:BTC)
click to toggle source
# File lib/mintpal_ruby.rb, line 33 def market_stats(coin, exchange=:BTC) exchange = exchange.to_sym.upcase raise ArgumentError, "You must specify a valid exchange: #{VALID_EXCHANGES}!" if !VALID_EXCHANGES.include?(exchange) coin = coin.to_sym.upcase raise ArgumentError, "You must specify a valid coin: #{VALID_COINS}!" if !VALID_COINS.include?(coin) response = JSON.parse(Mechanize.new.get("#{API_URL}/stats/#{coin}/#{exchange}")) CoinSummary.new(response.first) end
market_summary(exchange=nil)
click to toggle source
# File lib/mintpal_ruby.rb, line 22 def market_summary(exchange=nil) if exchange.is_a?(Symbol) || exchange.is_a?(String) exchange = exchange.to_sym.upcase raise ArgumentError, "You must specify a valid exchange: #{VALID_EXCHANGES}!" if !VALID_EXCHANGES.include?(exchange) response = JSON.parse(Mechanize.new.get("#{API_URL}/summary/#{exchange}").body) else response = JSON.parse(Mechanize.new.get("#{API_URL}/summary").body) end response.map {|c| CoinSummary.new(c) } end
market_trades()
click to toggle source
# File lib/mintpal_ruby.rb, line 43 def market_trades # end