lib/notification_pusher/notification_library.rb in notification-pusher-1.0.0.beta9 vs lib/notification_pusher/notification_library.rb in notification-pusher-1.0.0.beta10
- old
+ new
@@ -22,23 +22,17 @@
private
def initialize_pusher
unless self.push.nil?
- if self.push.kind_of(Array)
+ if self.push.kind_of?(Array)
self.push.each do |class_name|
- pusher = NotificationPusher::Pusher.find_by_name(class_name).last
- if defined?(NotificationPusher.const_get(pusher.name))
- options = pusher.options.merge! self.push_options[class_name.to_sym]
- pusher.instances << NotificationPusher.const_get(pusher.name).new self, options
- end
+ pusher = NotificationPusher::Pusher.find_by_name(class_name).first
+ pusher.push(self, self.push_options[class_name.to_sym])
end
else
- pusher = NotificationPusher::Pusher.find_by_name(self.push).last
- if defined?(NotificationPusher.const_get(pusher.name))
- options = pusher.options.merge! self.push_options
- pusher.instances << NotificationPusher.const_get(pusher.name).new self, options
- end
+ pusher = NotificationPusher::Pusher.find_by_name(self.push).first
+ pusher.push(self, self.push_options)
end
end
end
end