Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme and release version 1.0.0 #193

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
lunchmoney (0.10.0)
lunchmoney (1.0.0)
activesupport (>= 6.1)
faraday (>= 1.0.0)
sorbet-runtime (>= 0.5)
Expand Down
43 changes: 38 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
[![CI](https://github.com/halorrr/lunchmoney/actions/workflows/ci.yml/badge.svg)](https://github.com/halorrr/lunchmoney/actions/workflows/ci.yml)
[![Yard Docs](https://github.com/halorrr/lunchmoney/actions/workflows/build_and_publish_yard_docs.yml/badge.svg)](https://github.com/halorrr/lunchmoney/actions/workflows/build_and_publish_yard_docs.yml)

This gem and readme are very much a work in progress. More to come!
This gem is a API client library of the [LunchMoney API](https://lunchmoney.dev/) for the wonderful [LunchMoney](http://lunchmoney.app/) web app for personal finance & budgeting.

This gem is a library of the [LunchMoney API](https://lunchmoney.dev/) for the wonderful [LunchMoney](http://lunchmoney.app/) web app for personal finance & budgeting.

You can find the yard docs for this gem [here](https://halorrr.github.io/lunchmoney/)
Documentation is still a work in process, but you can find the yard docs for this gem [here](https://halorrr.github.io/lunchmoney/) as well as some write ups of the basics below.

## Usage

Expand Down Expand Up @@ -40,13 +38,48 @@ LunchMoney::Api.new(api_key: "your_api_key")

### Using the API

Create an instance of the api, then call the endpoint you need:
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:

```Ruby
api = LunchMoney::Api.new
api.categories
```

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.

```Ruby
api = LunchMoney::Api.new
response = api.categories

response.class
=> LunchMoney::Errors

response.messages
=> ["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:

```Ruby
api = LunchMoney::Api.new
response = api.categories

response.class
=> LunchMoney::Errors

response.first
=> "Some error returned by the API"

response.empty?
=> false

response[0]
=> "Some error returned by the API"
```

## Contributing to this repo

Feel free to contribute and submit PRs to improve this gem
Expand Down
2 changes: 1 addition & 1 deletion lib/lunchmoney/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

module LunchMoney
# Current version of the gem
VERSION = "0.10.0"
VERSION = "1.0.0"
end