vol1ura/Sat_9am_5km

View on GitHub
app/services/telegram/notification/user/base.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module Telegram
  module Notification
    module User
      class Base < Notification::Base
        def initialize(user)
          @user = user
        end

        def call
          return unless @user&.telegram_id

          notify(@user.telegram_id)
        rescue StandardError => e
          Rollbar.error e, user_id: @user.id
        end
      end
    end
  end
end