Module: Xurrency::Request

Defined in:
lib/xurrency.rb

Class Method Summary collapse

Class Method Details

.currenciesObject

getCurrencies



50
51
52
# File 'lib/xurrency.rb', line 50

def currencies
  Client.instance.getCurrencies
end

.currency?(code) ⇒ Boolean

isCurrency(code)

Returns:

  • (Boolean)


45
46
47
# File 'lib/xurrency.rb', line 45

def currency?(code)
  Client.instance.isCurrency(code)
end

.currency_name(code) ⇒ Object

getName(code)



30
31
32
# File 'lib/xurrency.rb', line 30

def currency_name(code)
  Client.instance.getName(code)
end

.url(code) ⇒ Object

getURL(code)



40
41
42
# File 'lib/xurrency.rb', line 40

def url(code)
  Client.instance.getURL(code)
end

.value(amount, base, target) ⇒ Object

getValue(amount, base, target)



73
74
75
# File 'lib/xurrency.rb', line 73

def value(amount, base, target)
  Client.instance.getValue(amount, base, target)
end

.values(code) ⇒ Object

getValues(code)



55
56
57
58
59
60
61
# File 'lib/xurrency.rb', line 55

def values(code)
  table = {}
  Client.instance.getValues(code).each do |c|
    table[c["Id"]] = c["Value"]
  end
  return table
end

.values_inverse(code) ⇒ Object

getValuesInverse(code)



64
65
66
67
68
69
70
# File 'lib/xurrency.rb', line 64

def values_inverse(code)
  table = {}
  Client.instance.getValuesInverse(code).each do |c|
    table[c["Id"]] = c["Value"]
  end
  return table
end

.zone(code) ⇒ Object

getZone(code)



35
36
37
# File 'lib/xurrency.rb', line 35

def zone(code)
  Client.instance.getZone(code)
end