103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# File 'lib/vayacondios/client/notifier.rb', line 103
def self.included klass
if klass.ancestors.include? Gorillib::Model
klass.class_eval do
field :notifier, Vayacondios::NotifierFactory, default: Vayacondios.default_notifier, :doc => "Notifier used to notify out of band data"
def receive_notifier params
params.merge!(log: try(:log)) if params[:type] == 'log'
@notifier = Vayacondios::NotifierFactory.receive(params)
end
end
else
klass.class_attribute :notifier
klass.notifier = Vayacondios.default_notifier try(:log)
end
end
|