<commit_before># Crunch::Api

[![Gem Version](https://badge.fury.io/rb/crunch-api.png)][gem]
[![Build Status](https://travis-ci.org/achambers/crunch-api.png)][travis]

[gem]: http://badge.fury.io/rb/crunch-api
[travis]: https://travis-ci.org/achambers/crunch-api

A Ruby interface to the Crunch Accounting API

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'crunch-api'
```

And then execute:

```bash
$ bundle
```

Or install it yourself as:

```bash
$ gem install crunch-api
```

## Quick Start Guide

Hurry up and show me how to call the service already...

First you need to register your application with Crunch Accounting using OAuth

Next require the gem:

```ruby
require 'crunch-api'
```

Then, copy and paste your OAuth credentials into the configuration:

```ruby
CrunchApi.configure do |config|
  config.consumer_key = YOUR_CONSUMER_KEY
  config.consumer_secret = YOUR_CONSUMER_SECRET
  config.oauth_token = YOUR_OAUTH_TOKEN
  config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
```

And there you, you're all set to access some Crunchy goodness

```ruby
CrunchApi::Supplier.for_id(123)
```

For more examples of how to use this gem, see the [Usage Examples][] below

[Usage Examples]: #usage-examples

## Usage Examples

All examples require OAuth configuration to be set in order to authenticate

**Get all suppliers**

```ruby
CrunchApi::Supplier.all
```

**Get a specific supplier**

```ruby
CrunchApi::Supplier.for_id(123)
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)<commit_msg>Updating latest usage examples for supplier methods<commit_after># Crunch::Api

[![Gem Version](https://badge.fury.io/rb/crunch-api.png)][gem]
[![Build Status](https://travis-ci.org/achambers/crunch-api.png)][travis]

[gem]: http://badge.fury.io/rb/crunch-api
[travis]: https://travis-ci.org/achambers/crunch-api

A Ruby interface to the Crunch Accounting API

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'crunch-api'
```

And then execute:

```bash
$ bundle
```

Or install it yourself as:

```bash
$ gem install crunch-api
```

## Quick Start Guide

Hurry up and show me how to call the service already...

First you need to register your application with Crunch Accounting using OAuth

Next require the gem:

```ruby
require 'crunch-api'
```

Then, copy and paste your OAuth credentials into the configuration:

```ruby
CrunchApi.configure do |config|
  config.consumer_key = YOUR_CONSUMER_KEY
  config.consumer_secret = YOUR_CONSUMER_SECRET
  config.oauth_token = YOUR_OAUTH_TOKEN
  config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
```

And there you go, you're all set to access some Crunchy goodness

```ruby
CrunchApi::Supplier.for_id(123)
```

For more examples of how to use this gem, see the [Usage Examples][] below

[Usage Examples]: #usage-examples

## Usage Examples

All examples require OAuth configuration to be set in order to authenticate

**Get all suppliers**

```ruby
CrunchApi::Supplier.all
```

**Get a specific supplier**

```ruby
CrunchApi::Supplier.for_id(123)
```

**Create a new supplier**

```ruby
CrunchApi::Supplier.create(name: '<NAME>')
```

**Update an existing supplier**

```ruby
# using a hash of attributes
CrunchApi::Supplier.update(123, name: 'Test Supplier')

# using an existing supplier
supplier = CrunchApi::Supplier.for_id(123)

CrunchApi::Supplier.update(1, supplier)
```

**Delete a supplier**

```ruby
CrunchApi::Supplier.delete(123)
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
{'fraction_non_alphanumeric': 0.12555555555555556, 'fraction_numerical': 0.007222222222222222, 'mean_word_length': 4.971807628524046, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1580522', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1198, 'n_words': 374}