Sha256: 3ae7e3519f14a807fb696b55e9ad4f2e337ae2ab0bd3da8633104dc32bd6a4d1

Contents?: true

Size: 756 Bytes

Versions: 11

Compression:

Stored size: 756 Bytes

Contents

module Integrity
  class Project
    module Notifiers
      def notifies?(notifier)
        return false unless notifier = notifiers.first(:name => notifier)

        notifier.enabled?
      end

      def enabled_notifiers
        notifiers.all(:enabled => true)
      end

      def config_for(notifier)
        notifier = notifiers.first(:name => notifier)
        notifier ? notifier.config : {}
      end

      def update_notifiers(to_enable, config)
        config.each_pair { |name, config|
          notifier = notifiers.first(:name => name)
          notifier ||= notifiers.new(:name => name)

          notifier.enabled = to_enable.include?(name)
          notifier.config  = config
          notifier.save
        }
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
alphasights-integrity-0.1.10 lib/integrity/project/notifiers.rb
alphasights-integrity-0.1.9.3 lib/integrity/project/notifiers.rb
alphasights-integrity-0.1.9.4 lib/integrity/project/notifiers.rb
alphasights-integrity-0.1.9.5 lib/integrity/project/notifiers.rb
alphasights-integrity-0.1.9.6 lib/integrity/project/notifiers.rb
alphasights-integrity-0.1.9.7 lib/integrity/project/notifiers.rb
alphasights-integrity-0.1.9.8 lib/integrity/project/notifiers.rb
integrity-integrity-0.1.10 lib/integrity/project/notifiers.rb
integrity-integrity-0.1.9.3 lib/integrity/project/notifiers.rb
integrity-0.1.11 lib/integrity/project/notifiers.rb
integrity-0.1.10 lib/integrity/project/notifiers.rb