Gem Version CI Yard Docs

This gem is a API client library of the LunchMoney API for the wonderful LunchMoney web app for personal finance & budgeting.

Documentation is still a work in process, but you can find the yard docs for this gem here as well as some write ups of the basics below. An example of every call is listed on the Api class in the yard docs.



Add this line to your application's Gemfile:

gem "lunchmoney"

Set your lunchmoney token

There are a few ways you can set your API token. You can set it manually using a configure block:

LunchMoney.configure do |config|
  config.api_key = "your_api_key"

The config will also automatically pull in the token if set via environment variable named LUNCHMONEY_TOKEN

You can also override the config and set your LunchMoney token for a specific API instance via kwarg: "your_api_key")

Using the API

It is intended that all calls typically go through a LunchMoney::Api instannce. This class delegates methods to their relvant classes behind the scenes. Create an instance of the api, then call the endpoint you need:

api =

When the api returns an error a LunchMoney::Errors object will be returned. You can check the errors that occured via .messages on the instance. This will return an array of errors.

api =
response = api.categories

=> LunchMoney::Errors

=> ["Some error returned by the API"]

The instance itself has been set up to act like an array, delegating a lot of common array getter methods directly to messages for you. This enables things like:

api =
response = api.categories

=> LunchMoney::Errors

=> "Some error returned by the API"

=> false

=> "Some error returned by the API"

Contributing to this repo

Feel free to contribute and submit PRs to improve this gem

Releasing a new gem version

  1. Bump the VERSION constant in lib/lunchmoney/version.rb
  2. Run bundle install
  3. Commit and push up the change in a PR
  4. Merge the PR
  5. Create a new tag and release with the name version as v0.0.0
  6. A Github action will kick off and publish the new gem version