<commit_before># Drip Ruby Bindings

A Ruby toolkit for the [Drip](https://www.getdrip.com/) API.

## Installation

Add this line to your application's Gemfile:

    gem 'drip-ruby'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install drip-ruby

## Usage

To begin making requests, spin up a new Drip client:

```ruby
client = Drip::Client.new do |c|
  c.api_key = "YOUR_API_TOKEN"
  c.account_id = "YOUR_ACCOUNT_ID"
end
```

You can find your API key [here](https://www.getdrip.com/settings/general)
and your account ID [here](https://www.getdrip.com/settings/site).

Since the Drip client is a flat API client, most API actions are available
as methods on the client object. The following methods are currently available:

| Action                     | Method                                               |
| :------------------------- | :--------------------------------------------------- |
| Create/update a subscriber | `#create_or_update_subscriber(email, options = {})`  |
| Fetch a subscriber         | `#subscriber(id_or_email)`                           |
| Subscribe to a campaign    | `#subscribe(email, campaign_id, options = {})`       |
| Unsubscribe                | `#unsubscribe(id_or_email, options = {})`            |
| Apply a tag                | `#apply_tag(email, tag)`                             |
| Remove a tag               | `#remove_tag(email, tag)`                            |
| Track an event             | `#track_event(email, action, properties = {})`       |


**Note:** We do not yet have complete API coverage. If we are missing an API method
that you need to use in your application, please file an issue and/or open a
pull request.

## Examples

```ruby
client = Drip::Client.new do |c|
  c.api_key = "YOUR_API_TOKEN"
  c.account_id = "YOUR_ACCOUNT_ID"
end

# Fetch a subscriber
resp = client.subscriber("<EMAIL>")
# => <Drip::Response ...>

resp.success?
# => true

subscriber = resp.subscribers.first
subscriber.email
# => "<EMAIL>"
```<commit_msg>Add link to official docs<commit_after># Drip Ruby Bindings

A Ruby toolkit for the [Drip](https://www.getdrip.com/) API.

## Installation

Add this line to your application's Gemfile:

    gem 'drip-ruby'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install drip-ruby

## Usage

To begin making requests, spin up a new Drip client:

```ruby
client = Drip::Client.new do |c|
  c.api_key = "YOUR_API_TOKEN"
  c.account_id = "YOUR_ACCOUNT_ID"
end
```

You can find your API key [here](https://www.getdrip.com/settings/general)
and your account ID [here](https://www.getdrip.com/settings/site).

Since the Drip client is a flat API client, most API actions are available
as methods on the client object. The following methods are currently available:

| Action                     | Method                                               |
| :------------------------- | :--------------------------------------------------- |
| Create/update a subscriber | `#create_or_update_subscriber(email, options = {})`  |
| Fetch a subscriber         | `#subscriber(id_or_email)`                           |
| Subscribe to a campaign    | `#subscribe(email, campaign_id, options = {})`       |
| Unsubscribe                | `#unsubscribe(id_or_email, options = {})`            |
| Apply a tag                | `#apply_tag(email, tag)`                             |
| Remove a tag               | `#remove_tag(email, tag)`                            |
| Track an event             | `#track_event(email, action, properties = {})`       |


**Note:** We do not have complete API coverage yet. If we are missing an API method
that you need to use in your application, please file an issue and/or open a
pull request. [See the official REST API docs](https://www.getdrip.com/docs/rest-api)
for a complete API reference.

## Examples

```ruby
client = Drip::Client.new do |c|
  c.api_key = "YOUR_API_TOKEN"
  c.account_id = "YOUR_ACCOUNT_ID"
end

# Fetch a subscriber
resp = client.subscriber("<EMAIL>")
# => <Drip::Response ...>

resp.success?
# => true

subscriber = resp.subscribers.first
subscriber.email
# => "<EMAIL>"
```
{'fraction_non_alphanumeric': 0.14942252165543793, 'fraction_numerical': 0.0, 'mean_word_length': 2.1927803379416284, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 7, 'lorem ipsum': 0, 'www.': 7, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3560698', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1221, 'n_words': 385}