Sha256: cfed3cd97ecb1fe9ad05e3888e96dece6b9be18e08774dc237874308c271554a

Contents?: true

Size: 646 Bytes

Versions: 3

Compression:

Stored size: 646 Bytes

Contents

class BMC::FCM::Notifier
  attr_reader :to, :title, :body, :badge, :sound, :data

  # rubocop:disable Metrics/ParameterLists
  def initialize(to:, title: nil, body:, badge: 0, sound: "default", data: {})
    super()
    @to    = to
    @title = title
    @body  = body
    @badge = badge
    @sound = sound
    @data  = data
  end
  # rubocop:enable Metrics/ParameterLists

  def call
    BMC::FCM::Request.call(
      :to => to,
      :notification => {
        :title => title,
        :body  => body,
        :badge => badge,
        :sound => sound,
      },
      :data => data,
    )
  end

  def self.call(...)
    new(...).call
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bmc-1.1.0 app/libs/bmc/fcm/notifier.rb
bmc-1.0.1 app/libs/bmc/fcm/notifier.rb
bmc-1.0.0 app/libs/bmc/fcm/notifier.rb