class SocialWeb::Hooks::Registry

Attributes

hooks[RW]

Public Class Methods

instance() click to toggle source
# File lib/social_web/hooks.rb, line 51
def self.instance
  @instance ||= new
end
new() click to toggle source
# File lib/social_web/hooks.rb, line 55
def initialize
  @hooks = {}
end

Public Instance Methods

[](name) click to toggle source
# File lib/social_web/hooks.rb, line 59
def [](name)
  @hooks[name]
end
register(name, &action) click to toggle source
# File lib/social_web/hooks.rb, line 63
def register(name, &action)
  @hooks[name] = action.to_proc
end