module Juhe::Exchange

Constants

URL

Public Instance Methods

currency(key, from, to) click to toggle source

实时汇率查询换算 www.juhe.cn/docs/api/id/80/aid/205

# File lib/juhe/exchange.rb, line 7
def currency(key, from, to)
  res = RestClient.get("#{URL}/currency", params: {key: key, from: from, to: to})
  JSON.parse res.body
end
list(key) click to toggle source

货币列表 www.juhe.cn/docs/api/id/80/aid/204

# File lib/juhe/exchange.rb, line 19
def list(key)
  res = RestClient.get("#{URL}/list", params: {key: key})
  JSON.parse res.body
end
query(key) click to toggle source

常用汇率查询 www.juhe.cn/docs/api/id/80

# File lib/juhe/exchange.rb, line 13
def query(key)
  res = RestClient.get("#{URL}/query", params: {key: key})
  JSON.parse res.body
end