Class: Mutx::Workers::Notificator

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/mutx/background_jobs/workers/notificator.rb

Instance Method Summary collapse

Instance Method Details

#email(mail_to, subject: '', body: '', attachment: nil) ⇒ Object



16
17
18
# File 'lib/mutx/background_jobs/workers/notificator.rb', line 16

def email(mail_to, subject: '', body: '', attachment: nil)
  # TODO
end

#perform(type, destination, args = {}) ⇒ Object



7
8
9
10
# File 'lib/mutx/background_jobs/workers/notificator.rb', line 7

def perform(type, destination, args= {})
  simbolized = args.map { |k, v| [k.to_sym, v] }.to_h
  self.send(type.to_sym, destination, **simbolized)
end

#telegram(group_id, message: '') ⇒ Object



12
13
14
# File 'lib/mutx/background_jobs/workers/notificator.rb', line 12

def telegram(group_id, message: '')
  Support::TelegramSender.send_message(group_id, message)
end