Class: ATS::Event
- Inherits:
-
Object
- Object
- ATS::Event
- Defined in:
- lib/ats/event.rb
Class Method Summary collapse
Class Method Details
.create(params = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/ats/event.rb', line 3 def self.create(params = {}) sns = Aws::SNS::Resource.new(region: ATS.region) topic = sns.topic(ATS.topic) event = { id: SecureRandom.uuid, version: "v1", client_timestamp: DateTime.now.to_s } event.merge!(params) topic.publish({ message: JSON.pretty_generate(event) }) end |