Class: NatsWork::Instrumentation::Subscription
- Inherits:
-
Object
- Object
- NatsWork::Instrumentation::Subscription
- Defined in:
- lib/natswork/instrumentation.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
- #call(payload) ⇒ Object
-
#initialize(event, callback) ⇒ Subscription
constructor
A new instance of Subscription.
Constructor Details
#initialize(event, callback) ⇒ Subscription
Returns a new instance of Subscription.
100 101 102 103 |
# File 'lib/natswork/instrumentation.rb', line 100 def initialize(event, callback) @event = event.to_s @callback = callback end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
98 99 100 |
# File 'lib/natswork/instrumentation.rb', line 98 def callback @callback end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
98 99 100 |
# File 'lib/natswork/instrumentation.rb', line 98 def event @event end |
Instance Method Details
#call(payload) ⇒ Object
105 106 107 |
# File 'lib/natswork/instrumentation.rb', line 105 def call(payload) @callback.call(payload) end |