aws-broker 0.0.7 → 0.0.8

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
  SHA1:
3
- metadata.gz: 1a2b0655af91c388ff08600509ef40fb6bd5598c
4
- data.tar.gz: f642d65e645ef19c27922cadfa1a0b8a54b79444
3
+ metadata.gz: 866d2c2327d8e85e2f1d10788f61569771447af4
4
+ data.tar.gz: 1a49115f99646b64470105d3575bdc304bd7717d
5
5
  SHA512:
6
- metadata.gz: 2f0291bee882923c0a1d231cd7d6b447413b9f61039bcabedda34a91969b327a9415a77fe1d8a48d335cf5c810632c19a02b5c0da232f6ce556f63c71c96f029
7
- data.tar.gz: 360ebdb0eef7fc232e4dcbfdcacaea35397b33e3d7cf1efd90e69545746fdcb4c560d827804fe68c2e191b6460147aabb08d8d3236840ebde93a566c990e914d
6
+ metadata.gz: 3a646bf34bbb98d086c0fa98e5dee5199f56e91ffb7ffd851d02bcc1c2f2a8ecba90443433d764c836fed0744c0ded1985cb2883920d5f9fe8f568bcd9506c4b
7
+ data.tar.gz: 758de299e90382d3154d9c121bf0489b403ad6557c826dee5240633706de05a59498ab543371465cd82eadc8f3ca7e1cc2fe52c5f29cb69f97b8326457f464f0
data/README.md CHANGED
@@ -44,6 +44,8 @@ callbacks.
44
44
  # app/models/user.rb
45
45
  class User < ActiveRecord::Base
46
46
  publish_event :create, :update, :destroy
47
+ # optionally override default topic name
48
+ # self.publish_topic = :prefixed_user
47
49
  end
48
50
 
49
51
  The above is essentially shorthand for
@@ -12,7 +12,7 @@ module Aws
12
12
  method_name = :"publish_event_#{event}"
13
13
  define_method method_name do
14
14
  Broker.publish(
15
- self.class.to_s.underscore.tr('/', '_'),
15
+ self.class.publish_topic,
16
16
  event: event,
17
17
  id: id
18
18
  )
@@ -21,6 +21,19 @@ module Aws
21
21
  end
22
22
  end
23
23
 
24
+ def publish_topic
25
+ if defined?(@@publish_topic)
26
+ @@publish_topic
27
+ else
28
+ to_s.underscore.tr('/', '_')
29
+ end
30
+ end
31
+
32
+ # optional override of default topic
33
+ def publish_topic=(topic)
34
+ @@publish_topic = topic
35
+ end
36
+
24
37
  end
25
38
  end
26
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-broker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eng @ Thanx
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-02 00:00:00.000000000 Z
11
+ date: 2017-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sns