<commit_before># Slim-API Ruby

Accessing SlimApi and work with clients, contracts, campaigns and statistics

## Instalation

Just in console

``` ruby
gem install slim-api-ruby
```

Or put into Gemfile

``` ruby
gem "slim-api-ruby"
```

and somewhere before use (not rails - they will require gem automaticaly)
``` ruby
require "slim-api"
```

## Initialization

Setup your config values

``` ruby
SlimApi.api_token = "YOUR_TOKEN"
```

## Working with Gem

You can access Main classes: Client, Contract, Campaign, Statistics, Category

### How classes works

[SlimApi documentation](http://slimapi.ataxo.com/doc/v1)

``` ruby
# Find some objects:
campaigns = SlimApi::Client.find
# you got [ <Client:..>, ... ] and choose first one
campaign = campaigns.first
# then you can ask for something
campaign.name #=> "Client Name"
campaign.id #=> 123456
```

Arguments from api is hash, this hash is saved by hashr directly into instance.
**Instance is still Hash, you can do all stuf like with normal hash.**

### Find<commit_msg>[FIX] Readme - add taxonomy specification<commit_after># Slim-API Ruby

Accessing SlimApi and work with clients, contracts, campaigns and statistics

## Instalation

Just in console

``` ruby
gem install slim-api-ruby
```

Or put into Gemfile

``` ruby
gem "slim-api-ruby"
```

and somewhere before use (not rails - they will require gem automaticaly)
``` ruby
require "slim-api"
```

## Initialization

Setup your config values

``` ruby
SlimApi.api_token = "YOUR_TOKEN"
SlimApi.taxonomy = "YOUR_TAXONOMY"

#optional settings
SlimApi.version = :v1
#default is :v1

#url where is slim api located
SlimApi.url = "http://slimapi.ataxo.com"
```

## Working with Gem

You can access Main classes: Client, Contract, Campaign, Statistics, Category

### How classes works

[SlimApi documentation](http://slimapi.ataxo.com/doc/v1)

``` ruby
# Find some objects:
campaigns = SlimApi::Client.find
# you got [ <Client:..>, ... ] and choose first one
campaign = campaigns.first
# then you can ask for something
campaign.name #=> "<NAME>"
campaign.id #=> 123456
```

Arguments from api is hash, this hash is saved by hashr directly into instance.
**Instance is still Hash, you can do all stuf like with normal hash.**

### Find
{'fraction_non_alphanumeric': 0.11835640911121036, 'fraction_numerical': 0.007146047342563644, 'mean_word_length': 4.397590361445783, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, 'https://': 0, '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': '5851227', 'n_tokens_mistral': 754, 'n_tokens_neox': 698, 'n_words': 263}