lib/notification_pusher/pusher.rb in notification-pusher-1.0.0.beta10 vs lib/notification_pusher/pusher.rb in notification-pusher-1.0.0.beta11
- old
+ new
@@ -11,18 +11,18 @@
@options = options
end
def push notification, options = {}
default_options = self.options
- options = default_options.merge! options
- if defined?(NotificationPusher.const_get(pusher.name))
+ options = options.nil? ? default_options : default_options.merge!(options)
+ if defined?(NotificationPusher.const_get(self.name))
instance = NotificationPusher.const_get(self.name).new notification, options
self.instances << instance
end
end
def self.find_by_name name
- ObjectSpace.each_object(NotificationPusher::Pusher).select { |pusher| pusher.name == name }
+ NotificationPusher.configuration.pushers.select { |pusher| pusher.name == name }
end
end
end