<commit_before># Ruby on Rails Integration

Flexirest works fine with Ruby on Rails Framework. This guide was tested with a Rails 4.2.x Application.


## Integration

Start referencing `flexirest` in you `Gemfile`

```ruby
# Gemfile
gem 'flexirest'
```


## Configuration

It's possible to explicit specify the `base_url` in the Model Class. If you have an common API Endpoint it makes sense to setup an initializer in `config/initializer` or use the `Rails.application.configure` namespace.

This example use a custom file in `config/initializer` to setup the API endpoint. Either set a fixed URL or use environment variables if you would like to follow the [12factor](http://12factor.net/config) rules for preparing your application running on cloud infrastructure like heroku.

```ruby
# config/initializer/flexirest.rb
Flexirest::Base.base_url = ENV.fetch("API_ENDPOINT_URL")<commit_msg>fix typo<commit_after># Ruby on Rails Integration

Flexirest works fine with Ruby on Rails Framework. This guide was tested with a Rails 4.2.x Application.


## Integration

Start referencing `flexirest` in your `Gemfile`

```ruby
# Gemfile
gem 'flexirest'
```


## Configuration

It's possible to explicit specify the `base_url` in the Model Class. If you have an common API Endpoint it makes sense to setup an initializer in `config/initializer` or use the `Rails.application.configure` namespace.

This example use a custom file in `config/initializer` to setup the API endpoint. Either set a fixed URL or use environment variables if you would like to follow the [12factor](http://12factor.net/config) rules for preparing your application running on cloud infrastructure like heroku.

```ruby
# config/initializer/flexirest.rb
Flexirest::Base.base_url = ENV.fetch("API_ENDPOINT_URL")
{'fraction_non_alphanumeric': 0.07536557930258718, 'fraction_numerical': 0.006749156355455568, 'mean_word_length': 5.010135135135135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '490508', 'n_tokens_mistral': 519, 'n_tokens_neox': 478, 'n_words': 222}