Module: Shanty::Mixins::Callbacks::ClassMethods

Defined in:
lib/shanty/mixins/callbacks.rb

Overview

Common methods inherited by all classes

Instance Method Summary collapse

Instance Method Details

#class_callbacksObject



21
22
23
# File 'lib/shanty/mixins/callbacks.rb', line 21

def class_callbacks
  @class_callbacks ||= Hash.new { |h, k| h[k] = [] }
end

#subscribe(*names, sym) ⇒ Object



25
26
27
28
29
# File 'lib/shanty/mixins/callbacks.rb', line 25

def subscribe(*names, sym)
  names.each do |name|
    class_callbacks[name] << sym
  end
end