Small Sinatra app and API utilising https://github.com/mattfield/exchange_rate to calculate exchange ranges.
- Clone the repo
- Run
bundle
to grab gems
- Run
rake fetch_feed
to grab the latest ECB feed (places inpublic/data/
bundle exec ruby app.rb
- Go to
localhost:4567
NB If you don't want to grab a copy of the feed, change the feed_path
entry in config/exchange_rate.yml
Renders the homepage
Calculates conversion of amount
from from
currency to to
currency
Redirects to /rates/all/?
Prints an Array of the whole available ECB feed in format: { :date => String(xmlschema-formatted), :iso => String, :rate => Float }
Prints a Hash of currencies and rates for the given date in format: { currency<String>, rate<String> }