ats-sdk 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +52 -0
  3. data/ats-sdk.gemspec +1 -1
  4. data/lib/ats/event.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cc57165dd92bd828b321a7527599fa9a4a8e923f614377df9adc4e0ba92e0e3
4
- data.tar.gz: bd42dfdb04df86825c81546a01bfc4560b742e02b535f90461a48548c3d90f2e
3
+ metadata.gz: ec55809b7ce4eb291ff66e5b1cb2d89fc0defecb03cbf71b9208f57a70187d5e
4
+ data.tar.gz: 4c0a56b41a766c63e99a633d05ab016ef7db74dd77ed5e3c08b105a1a8eb9cee
5
5
  SHA512:
6
- metadata.gz: b3bbcf30297abdc28977fae82b0885b02bf6c5832f2e4790d0001403cfbace0e610855e9a761bb0d0132cff60e8e39ed6100c814dc3ee8fdbc2be199c3610aba
7
- data.tar.gz: cf4d5fe52daf290fc8232e8fd6af61e4b277fd9b875f3d0a001054a9195bd5ae6d9f6518162c7c94e6903c9048750bef0f92703ca5efdda71c1cd19a0ddcfbf3
6
+ metadata.gz: 6e11402bb87d2cd3d8a0f4c7db403c76be3f76e23d099591bf63be16010fcdf050b43330a80e3790415845d45c4968d3e95726a2f61e4f75a60a126fd2a453d7
7
+ data.tar.gz: ba667280e673ef818f8b04642c5176df647f67510577e183c587f37c95c2ed00535054b25976f6a28e83c7f8cd2939ff62068a5a747e1f2c3316a81c463a32d8
data/README.md CHANGED
@@ -0,0 +1,52 @@
1
+ # Ruby SDK for Entera's Activity Tracking System
2
+
3
+ > The **ATS SDK for Ruby** is a convenient way to create analytics [Events](https://sudomafia.quip.com/YoyKAtd4kYaQ#JYcABAVioB9) and publish them to an SNS topic
4
+
5
+ ## Getting Started
6
+
7
+ ### **Installation**
8
+
9
+ The **ATS SDK** is available from [RubyGems](http://https://rubygems.org). Add the following dependency to your Gemfile:
10
+
11
+ ```ruby
12
+ gem 'ats-sdk'
13
+ ```
14
+
15
+ ## Configuration
16
+
17
+ The **ATS SDK** uses the credentials and region from your **AWS SDK** configuration.
18
+
19
+ ### **Rails**
20
+
21
+ 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:
22
+
23
+ ```ruby
24
+ # config/initializers/ats.rb
25
+ ATS.configure do |config|
26
+ config.topic = 'arn:aws:sns:us-east-1:123456789012:my-topic'
27
+ end
28
+ ```
29
+
30
+ ## Quick Example
31
+
32
+ ### Create and publish an Event
33
+
34
+ ```ruby
35
+ event = {
36
+ subject: {
37
+ type: 'User',
38
+ key: 'fm-12iubg9uhaf82f'
39
+ },
40
+ verb: 'edit',
41
+ direct_object: {
42
+ type: 'Opportunity',
43
+ key: 'fe8f3a65-13ed-45b7-8ebf-45c24d321023'
44
+ },
45
+ context: {
46
+ field: 'broker_signature',
47
+ previous_value: 'Robert Salmos',
48
+ current_value: 'Robert Salmons'
49
+ }
50
+ }
51
+ ATS::Event.create(event)
52
+ ```
data/ats-sdk.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ats-sdk'
3
- s.version = '1.0.0'
3
+ s.version = '1.1.0'
4
4
  s.summary = "Ruby sdk for Entera's Activity Tracking System"
5
5
  s.description = 'ATS tracks activities using the Event Grammar.'
6
6
  s.authors = ['Carlos González']
data/lib/ats/event.rb CHANGED
@@ -11,7 +11,7 @@ module ATS
11
11
 
12
12
  event.merge!(params)
13
13
 
14
- topic.publish({ message: JSON.generate(event) })
14
+ topic.publish({ message: JSON.pretty_generate(event) })
15
15
  end
16
16
  end
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ats-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos González
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-03 00:00:00.000000000 Z
11
+ date: 2022-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sns