Class: ObserverCallbackContract
- Inherits:
-
ObserverCallback
- Object
- ObserverCallback
- ObserverCallbackContract
show all
- Defined in:
- ext/ae-rad/ae-rad-libs.rb
Instance Method Summary
collapse
Constructor Details
#initialize(_publisher, _subscriber, _method_update_to_call = :update, _channel = nil) ⇒ ObserverCallbackContract
Returns a new instance of ObserverCallbackContract.
849
850
851
852
853
|
# File 'ext/ae-rad/ae-rad-libs.rb', line 849
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
855
856
857
|
# File 'ext/ae-rad/ae-rad-libs.rb', line 855
def filter(_event)
@channel_conf != nil && @channel_conf != _event.channel
end
|
#update(_event, *args) ⇒ Object
859
860
861
|
# File 'ext/ae-rad/ae-rad-libs.rb', line 859
def update(_event, *args)
super(_event, *args) if !filter(_event)
end
|