Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/12joan/not-analytics-ruby-client

A Ruby client for not Analytics
https://github.com/12joan/not-analytics-ruby-client

Last synced: 23 days ago
JSON representation

A Ruby client for not Analytics

Awesome Lists containing this project

README

        

# not Analytics Ruby Client

A Ruby client for [not Analytics](https://github.com/12joan/not-analytics).

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'not-analytics-client', github: '12joan/not-analytics-ruby-client', branch: 'main'
```

And then execute:

$ bundle install

## Usage

Instantiate a new Hit object for a given app ID.

```ruby
hit = NotAnalyticsClient::Hit.new(
app_id: app_id,
event: '/some/path', # Optional
key: app_key, # Optional
)
```

Send the Hit to a not Analytics server.

```ruby
hit.post!(not_analytics_url: 'https://hit.example.com/')
# => #
```

Or output the JSON payload.

```ruby
hit.payload
# => "{\"hit\":{\"app_id\":"...
```