Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/newapplesho/oxr-smalltalk
Pharo Smalltalk wrapper for the Open Exchange Rates API
https://github.com/newapplesho/oxr-smalltalk
currency open-exchange-rates pharo smalltalk
Last synced: 6 days ago
JSON representation
Pharo Smalltalk wrapper for the Open Exchange Rates API
- Host: GitHub
- URL: https://github.com/newapplesho/oxr-smalltalk
- Owner: newapplesho
- License: apache-2.0
- Created: 2015-12-30T13:41:11.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-16T16:58:14.000Z (over 7 years ago)
- Last Synced: 2024-10-31T07:05:14.373Z (about 2 months ago)
- Topics: currency, open-exchange-rates, pharo, smalltalk
- Language: Smalltalk
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Open Exchange Rates [![Build Status](https://travis-ci.org/newapplesho/oxr-smalltalk.svg?branch=master)](https://travis-ci.org/newapplesho/oxr-smalltalk)
Pharo Smalltalk wrapper for the [Open Exchange Rates API](https://openexchangerates.org).## Requirement
- Pharo 3.0, Pharo 4.0, Pharo 5.0, Pharo 6.0, Pharo 6.1## Installation
```smalltalk
Metacello new
baseline: 'OXR';
repository: 'github://newapplesho/oxr-smalltalk:v0.1/pharo-repository';
load.
```## set up
```smalltalk
OXRSettings default applicationId:'Your App ID'.
```## Usage
You can read official documentation [here](https://oxr.readme.io/docs).
### /latest.json
Get the latest exchange rates available from the Open Exchange Rates API.```smalltalk
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.
```smalltalk
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.
```smalltalk
oxr := OpenExchangeRates new.
oxr convert: 19999.95 from: 'GBP' to: 'EUR'.
```### Changing Base Currency
```smalltalk
oxr := OpenExchangeRates new.
oxr baseCurrency: 'JPY'.
oxr getLatestExchangeRates.
```