class Rocketman::Registry
Public Class Methods
new()
click to toggle source
# File lib/rocketman/registry.rb, line 8 def initialize @registry = {} end
Public Instance Methods
event_exists?(event)
click to toggle source
# File lib/rocketman/registry.rb, line 32 def event_exists?(event) !@registry[event].nil? end
get_consumers_for(event)
click to toggle source
# File lib/rocketman/registry.rb, line 28 def get_consumers_for(event) @registry[event] end
get_events()
click to toggle source
# File lib/rocketman/registry.rb, line 24 def get_events @registry.keys end
register_consumer(event, consumer, action)
click to toggle source
# File lib/rocketman/registry.rb, line 20 def register_consumer(event, consumer, action) @registry[event][consumer] = action end
register_event(event)
click to toggle source
# File lib/rocketman/registry.rb, line 12 def register_event(event) if @registry[event] return @registry[event] else @registry[event] = {} end end