class ActivityPub::Hooks::Registry
Attributes
hooks[RW]
Public Class Methods
instance()
click to toggle source
# File lib/activity_pub/hooks.rb, line 60 def self.instance @instance ||= new end
new()
click to toggle source
# File lib/activity_pub/hooks.rb, line 64 def initialize @hooks = {} end
Public Instance Methods
[](name)
click to toggle source
# File lib/activity_pub/hooks.rb, line 68 def [](name) @hooks[name] end
register(name, &action)
click to toggle source
# File lib/activity_pub/hooks.rb, line 72 def register(name, &action) @hooks[name] ||= [] @hooks[name] << action.to_proc end