Module: ActiveNotifier::Core::ClassMethods
- Defined in:
- lib/active_notifier/core.rb
Instance Method Summary collapse
-
#exec(channel = nil, **options) ⇒ Object
Message execute.
Instance Method Details
#exec(channel = nil, **options) ⇒ Object
Message execute.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/active_notifier/core.rb', line 41 def exec(channel = nil, **) channel = channel&.to_sym token = [:token]&.to_s = [:message]&.to_s token_channel = [:token_channel]&.to_sym template = [:template]&.to_sym adapter = [:adapter]&.to_sym type = [:type]&.to_sym data = [:data].to_h token = fetch_token(token, token_channel, channel) template ||= channel type ||= get_type_by_template(template) ||= (template, type, data) = .except(:token, :message, :token_channel, :template, :adapter, :type, :data) adapter ||= ActiveNotifier.config.adapter.to_sym ActiveNotifier.adapt(adapter).notify(token, type, , ) end |