class ForexDataClient
Public Class Methods
new(api_key)
click to toggle source
# File lib/forex_quotes.rb, line 5 def initialize(api_key) @api_key = api_key end
Public Instance Methods
convert(from, to, quantity)
click to toggle source
# File lib/forex_quotes.rb, line 25 def convert(from, to, quantity) self.fetch('convert?cache=false&from=' + from + '&to=' + to + '&quantity=' + quantity.to_s) end
fetch(api_call)
click to toggle source
# File lib/forex_quotes.rb, line 9 def fetch(api_call) JSON.parse(HTTP.get("https://forex.1forge.com/1.0.2/" + api_call + "&api_key=" + @api_key)) end
getMarketStatus()
click to toggle source
# File lib/forex_quotes.rb, line 29 def getMarketStatus() self.fetch('market_status?cache=false') end
getQuotes(symbols)
click to toggle source
# File lib/forex_quotes.rb, line 21 def getQuotes(symbols) self.fetch('quotes?cache=false&pairs=' + symbols.join(',')) end
getSymbols()
click to toggle source
# File lib/forex_quotes.rb, line 17 def getSymbols() self.fetch('symbols?cache=false') end
quota()
click to toggle source
# File lib/forex_quotes.rb, line 13 def quota() self.fetch('quota?cache=false') end