Class: OEXRWrapper::CurrenciesResources

Inherits:
Resource
  • Object
show all
Defined in:
lib/oexrwrapper/resources/currencies.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#get_request, #initialize

Constructor Details

This class inherits a constructor from OEXRWrapper::Resource

Instance Method Details

#code_to_string(code) ⇒ Object Also known as: code_to_s



12
13
14
# File 'lib/oexrwrapper/resources/currencies.rb', line 12

def code_to_string(code)
  get_request('currencies').body[String(code).upcase]
end

#retrieveObject



3
4
5
6
7
8
9
10
# File 'lib/oexrwrapper/resources/currencies.rb', line 3

def retrieve
  currency_array = Array.new
  get_request('currencies').body.each do |currency|
    currency_array.push(Currency.new(currency[0], currency[1]))
  end

  Currencies.new currency_array
end