class Syndi::Events::Listener
A class which represents a listener.
Attributes
code[R]
event[R]
priority[R]
Public Class Methods
new(sys, event, priority, prc)
click to toggle source
Spawn a new listener object.
# File lib/syndi/events.rb, line 100 def initialize sys, event, priority, prc @sys = sys @event = event @priority = priority @code = prc Syndi.log.verbose "new listener spawned and attached to #{event}: #{self}", VNOISY end
Public Instance Methods
call(*args)
click to toggle source
Execute this listener.
# File lib/syndi/events.rb, line 115 def call *args @code.call *args end
deaf()
click to toggle source
Terminate this object.
# File lib/syndi/events.rb, line 110 def deaf @sys.events[event].delete self end
inspect()
click to toggle source
# File lib/syndi/events.rb, line 119 def inspect "<#Syndi::Events::Listener: sys=#@sys event=#@event priority=#@priority>" end
Also aliased as: to_s