Ruby SDK for Entera's Activity Tracking System
The ATS SDK for Ruby is a convenient way to create analytics Events and publish them to an SNS topic
Getting Started
Installation
The ATS SDK is available from RubyGems. Add the following dependency to your Gemfile:
gem 'ats-sdk'
Configuration
The ATS SDK uses the credentials and region from your AWS SDK configuration.
Rails
To use in a Rails
application, we recommend creating an initializer under the config/initializers
directory in order to bootstrap the ATS
object. There you will configure the ATS SDK with your SNS
topic:
ATS.configure do |config|
config.topic = 'arn:aws:sns:us-east-1:123456789012:my-topic'
end
Quick Example
Create and publish an Event
event = {
subject: {
type: 'User',
key: 'fm-12iubg9uhaf82f'
},
verb: 'edit',
direct_object: {
type: 'Opportunity',
key: 'fe8f3a65-13ed-45b7-8ebf-45c24d321023'
},
context: {
field: 'broker_signature',
previous_value: 'Robert Salmos',
current_value: 'Robert Salmons'
}
}
ATS::Event.create(event)