def call_action(condition, action)
before_items = self.behaviors
before_items += [condition] if condition
before_items.each do |b|
info = b.send("before_#{action}")
if info
msg = "#{self.name} before_#{action}: #{info} (#{b.base_name})"
applog(self, :info, msg)
end
end
if self.send(action)
msg = "#{self.name} #{action}: #{self.send(action).to_s}"
applog(self, :info, msg)
end
@process.call_action(action)
after_items = self.behaviors
after_items += [condition] if condition
after_items.each do |b|
info = b.send("after_#{action}")
if info
msg = "#{self.name} after_#{action}: #{info} (#{b.base_name})"
applog(self, :info, msg)
end
end
end