universalid 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da76bb6c2a7189ce9dfdd3c51e823bd4953d4e808d87f19bf3454071b6b12b38
4
- data.tar.gz: 9e5e859338c65f59f6a2db08c7c518591b234ff2351a3e23ecfa34044d6443a3
3
+ metadata.gz: '00684769ef0a97127ef4342a3b61ef58bba2f85a7fb1ddfe55118186f7c93662'
4
+ data.tar.gz: 4f871efbddfb4b580d60d556cd4ca12c8135f5331dad58bac19d3152b5066282
5
5
  SHA512:
6
- metadata.gz: eaa7ecb09b580b5aa197f3ae806027ea7a403b141617631f4036da0aaf1acd4d6af77a9a0776f45f5d8de192a81445a8d6ca358c6fd3b0bfce0edff31466754e
7
- data.tar.gz: e43c45212acf57c0cadfea74b18eeeb2f241efd2b9eced81af3e0013aaa76f605d671122fd8c9b2969a513fde62c1a27427e6823c2aa6b6259c7c41ca540f617
6
+ metadata.gz: 3a34c1492a6b4fc39babca2e246d5055fc2212104285e43a9ec4b460441d71886e76f77ebab3afb94b4f03cc03d3615975e2e348bafcbc473d7f67632cc36de6
7
+ data.tar.gz: 124d30882de946bf8abf6b801b44bb471c0df1d0b262f0424cb449707a01c2635b1f97892c0972bcff12411437a16b7f4fcfb0698162feafb2a3a231ce69b719
data/README.md CHANGED
@@ -1016,7 +1016,11 @@ This is especially useful in scenarios where the data format evolves over time,
1016
1016
  # | encoding options (whatever was passed to URI::UID.build or {})
1017
1017
  # | |
1018
1018
  uid = URI::UID.build(campaign) do |record, options|
1019
+ # NOTE: this feature is compatible with other tools like kiba, amoeba, etc.
1020
+ # that can be leveraged to generate the data to be encoded
1021
+
1019
1022
  data = { id: record.id, demo: true }
1023
+
1020
1024
  URI::UID.encode data, options.merge(include: %w[id demo]) # block returns the encoded payload
1021
1025
  end
1022
1026
  ```
@@ -1029,6 +1033,9 @@ This is especially useful in scenarios where the data format evolves over time,
1029
1033
  # the decoded payload from above | |
1030
1034
  # | | |
1031
1035
  decoded = URI::UID.parse(uid.to_s).decode do |data, klass, timestamp|
1036
+ # NOTE: this feature is compatible with other tools like kiba, amoeba, etc.
1037
+ # that can be leveraged to translate the decoded data into the correct format
1038
+
1032
1039
  record = klass.find_by(id: data[:id])
1033
1040
  record.instance_variable_set(:@demo, data[:demo])
1034
1041
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UniversalID
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/universal_id.rb CHANGED
@@ -5,17 +5,6 @@ require "forwardable"
5
5
  require "ostruct"
6
6
  require "uri"
7
7
 
8
- require_relative "universal_id/version"
9
- require_relative "universal_id/refinements"
10
- require_relative "universal_id/settings"
11
- require_relative "universal_id/encoder"
12
- require_relative "uri/uid"
13
- require_relative "universal_id/prepacker"
14
- require_relative "universal_id/prepack_options"
15
- require_relative "universal_id/message_pack_factory"
16
-
17
- UniversalID::Settings.instance # initialize settings
18
-
19
8
  module UniversalID
20
9
  module Contrib; end
21
10
 
@@ -27,3 +16,14 @@ module UniversalID
27
16
  end
28
17
  end
29
18
  end
19
+
20
+ require_relative "universal_id/version"
21
+ require_relative "universal_id/refinements"
22
+ require_relative "universal_id/settings"
23
+ require_relative "universal_id/encoder"
24
+ require_relative "uri/uid"
25
+ require_relative "universal_id/prepacker"
26
+ require_relative "universal_id/prepack_options"
27
+ require_relative "universal_id/message_pack_factory"
28
+
29
+ UniversalID::Settings.instance # initialize settings
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: universalid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Hopkins (hopsoft)