Class: NotifyOn::BulkConfig
- Inherits:
-
Object
- Object
- NotifyOn::BulkConfig
- Defined in:
- lib/notify_on/bulk_config.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ BulkConfig
constructor
A new instance of BulkConfig.
- #load ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ BulkConfig
Returns a new instance of BulkConfig.
6 7 |
# File 'lib/notify_on/bulk_config.rb', line 6 def initialize( = {}) end |
Class Method Details
.load ⇒ Object
9 10 11 |
# File 'lib/notify_on/bulk_config.rb', line 9 def self.load new.load end |
Instance Method Details
#load ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/notify_on/bulk_config.rb', line 13 def load return unless File.exists?(config_file) && config config.each do |model_name, notification_name| notification_name.each do |name, notify_on_config| model_name.classify.constantize.class_eval do notify_on (notify_on_config['action'] || notify_on_config['when']), notify_on_config.deep_symbolize_keys end end end end |