class WisperNext::Publisher::CallableAdapter

Attributes

callable[R]
event_name[R]

Public Class Methods

new(event_name, callable) click to toggle source
# File lib/wisper_next/publisher/callable_adapter.rb, line 10
def initialize(event_name, callable)
  @event_name  = event_name
  @callable    = callable
  freeze
end

Public Instance Methods

==(other) click to toggle source
# File lib/wisper_next/publisher/callable_adapter.rb, line 22
def ==(other)
  other == callable
end
on_event(name, payload) click to toggle source
# File lib/wisper_next/publisher/callable_adapter.rb, line 16
def on_event(name, payload)
  if name == @event_name
    @callable.call(payload)
  end
end