Skip to content
Pharo Smalltalk wrapper for the Open Exchange Rates API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pharo-repository
.gitignore
.smalltalk.ston
.travis.yml
LICENSE
README.md

README.md

Open Exchange Rates Build Status

Pharo Smalltalk wrapper for the Open Exchange Rates API.

Requirement

  • Pharo 3.0, Pharo 4.0, Pharo 5.0, Pharo 6.0, Pharo 6.1

Installation

Metacello new
    baseline: 'OXR';
    repository: 'github://newapplesho/oxr-smalltalk:v0.1/pharo-repository';
    load.

set up

OXRSettings default applicationId:'Your App ID'.

Usage

You can read official documentation here.

/latest.json

Get the latest exchange rates available from the Open Exchange Rates API.

oxr := OpenExchangeRates new.
oxr getLatestExchangeRates.

/currencies.json

Get a JSON list of all currency symbols available from the Open Exchange Rates API, along with their full names, for use in your integration.

oxr := OpenExchangeRates new.
oxr getCurrencies.

/convert

Convert any money value from one currency to another at the latest API rates using the /convert API endpoint.

oxr := OpenExchangeRates new.
oxr convert: 19999.95 from: 'GBP' to: 'EUR'.

Changing Base Currency

oxr := OpenExchangeRates new.
oxr baseCurrency: 'JPY'.
oxr getLatestExchangeRates.
You can’t perform that action at this time.