Module: PoolParty::Callbacks::InstanceMethods
- Defined in:
- lib/modules/callback.rb
Instance Method Summary collapse
Instance Method Details
#extend_callback_methods ⇒ Object
96 97 98 99 100 101 102 103 |
# File 'lib/modules/callback.rb', line 96 def extend_callback_methods unless self.class.classes.empty? self.class.classes.each do |klass| m = %{def #{klass.to_s.downcase};@#{klass.to_s.downcase} ||= #{klass}.new;end} self.class.class_eval m unless self.class.method_defined?(m) end end end |
#extend_callbacks ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/modules/callback.rb', line 105 def extend_callbacks unless self.class.callbacks.empty? self.class.callbacks.each do |mod| self.extend(mod) end end end |
#initialize(*args) ⇒ Object
91 92 93 94 |
# File 'lib/modules/callback.rb', line 91 def initialize(*args) extend_callbacks extend_callback_methods end |