hey-pubsub 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: db65819c7adc7ad9daaa79ce3a84a7f8a8d14d13
4
- data.tar.gz: e8e130a00d678bc0bb8e3d432106b5682dcea1d6
3
+ metadata.gz: 17e52d47a26ddc8bc246c9a529de490e5296b34e
4
+ data.tar.gz: b2802f7e7e17ea5177e1f4a8827bc68891365aad
5
5
  SHA512:
6
- metadata.gz: b7bfdd6b8a72804d692e6bdf5501db7ca5fdfb5934a0221d2d250a6315ade1411851d735462f3c2391ceac57c8cb8cb2462d7a4ad56f98790c76eb0dd4da56bc
7
- data.tar.gz: dcf7cf396f92c79b9e484523cc9ebcc3f60f7eea1ea345194a727a7b49b092d9f6ecb44515220493868177cd78598b515b5953a012093725a32bb82a0d47ee56
6
+ metadata.gz: 7f41afce64925bcfba2f0c476f916b15d37269aa72a8b517ae33dbeceb8aaf10e20556073e39d14faa1bf5ee27ec5493e7332b48a9e395f92be3839f68b17386
7
+ data.tar.gz: 97c26cd93623698941e0cc0e4a75445f53586b88b443a2108785662d0c8ee56f1904fe4e5c38ebbb96f77e3e27f2f1b89a70147e03c7bb0f95f20f454d0e7f4e
@@ -1,5 +1,6 @@
1
1
  class Hey::Pubsub::Event
2
- attr_writer :name, :metadata, :started_at, :ended_at
2
+ attr_writer :metadata, :started_at, :ended_at
3
+ attr_accessor :name
3
4
 
4
5
  def initialize(name:, started_at: nil, ended_at: nil, metadata: {})
5
6
  @name = name
@@ -33,11 +34,6 @@ class Hey::Pubsub::Event
33
34
  Hey::SanitizedHash.new(merged_data).to_h
34
35
  end
35
36
 
36
- def name
37
- return @name if Hey.configuration.namespace.nil?
38
- "#{Hey.configuration.namespace}.#{@name}"
39
- end
40
-
41
37
  def duration
42
38
  return if @ended_at.nil? || @started_at.nil?
43
39
  1000.0 * (@ended_at - @started_at)
data/lib/hey/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hey
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
data/lib/hey.rb CHANGED
@@ -15,6 +15,7 @@ module Hey
15
15
 
16
16
  module Behavior
17
17
  def publish!(event_name, payload = {}, &block)
18
+ event_name = "#{Hey.configuration.namespace}.#{event_name}" unless Hey.configuration.namespace.nil?
18
19
  event = Hey::Pubsub::Event.new(name: event_name, metadata: payload)
19
20
  pubsub_adapter.publish!(event, &block)
20
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hey-pubsub
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
  - ShippingEasy