Class: ObserverCallbackContract

Inherits:
ObserverCallback show all
Defined in:
ext/ae-rad/ae-rad-libs.rb

Direct Known Subclasses

ObserverCallbackContractThread

Instance Method Summary collapse

Constructor Details

#initialize(_publisher, _subscriber, _method_update_to_call = :update, _channel = nil) ⇒ ObserverCallbackContract

Returns a new instance of ObserverCallbackContract.



857
858
859
860
861
# File 'ext/ae-rad/ae-rad-libs.rb', line 857

def initialize(_publisher, _subscriber, _method_update_to_call=:update, _channel=nil)
 super(_publisher, _subscriber, _method_update_to_call)
 @channel = _channel
 @channel_conf = @subscriber.conf(@publisher.class.to_s+'.channel') if @subscriber.respond_to?(:conf)
end

Instance Method Details

#filter(_event) ⇒ Object



863
864
865
# File 'ext/ae-rad/ae-rad-libs.rb', line 863

def filter(_event)
  @channel_conf != nil && @channel_conf != _event.channel
end

#update(_event, *args) ⇒ Object



867
868
869
# File 'ext/ae-rad/ae-rad-libs.rb', line 867

def update(_event, *args)
 super(_event, *args) if !filter(_event)
end