class Yoda::Instrument::Subscription

Attributes

callback[R]

@return [#call]

instrument[R]

@return [Instrument]

name[R]

@return [String]

Public Class Methods

new(instrument:, name:, callback:) click to toggle source

@param instrument [Instrument] @param name [String] @param callback [#call]

# File lib/yoda/instrument.rb, line 18
def initialize(instrument:, name:, callback:)
  @instrument = instrument
  @name = name
  @callback = callback
end

Public Instance Methods

call(params) click to toggle source
# File lib/yoda/instrument.rb, line 28
def call(params)
  callback.call(params)
end
unsubscribe() click to toggle source
# File lib/yoda/instrument.rb, line 24
def unsubscribe
  instrument.unsubscribe(self)
end