class Signals::BlockListener

This is a Listener that once instantiated, will define a method that is named what is passed as the action.

Attributes

event[R]
listener[R]

Public Class Methods

new(event, &block) click to toggle source
# File lib/signals/block_listener.rb, line 8
def initialize(event, &block)
  @listener = block
  @event = event
end

Public Instance Methods

call(event, *args) click to toggle source
# File lib/signals/block_listener.rb, line 13
def call(event, *args)
  if self.event == event
    self.listener.call(*args)
  end
end