RubyintermediatebackendAI generated

Ruby Gem for Currency Conversion with Caching

Build a small reusable Ruby gem that fetches exchange rates from a public API, converts amounts between currencies, and caches rates locally to reduce API calls. Learners practice gem structure, HTTP requests, simple file-based caching, and writing a clean public API for a library.

Estimate
~7h
Steps
5
Completed by
0
Proposed by
codeseed.app

Faraday

Project roadmap

  1. 01

    Scaffold the gem structure

    ~1h

    Use bundle gem to create the gem skeleton with a lib folder and a CurrencyConverter class.

  2. 02

    Implement the API client

    ~1.5h

    Use Faraday to fetch current exchange rates from a public currency API and parse the JSON response.

  3. 03

    Add local caching

    ~1.5h

    Cache fetched rates to a local file with a timestamp, reusing cached rates if they're less than an hour old.

  4. 04

    Implement the conversion method

    ~1h

    Add a convert(amount, from, to) method that uses cached or freshly fetched rates.

  5. 05

    Write specs and usage docs

    ~2h

    Write RSpec tests with stubbed HTTP responses and document gem usage in the README.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~7h · 5 steps

Tech stack

Faraday