Sha256: 76fc472574c2219ad5a28c8d030f083abd465cf7a47b347baaaccc017d71f42e

Contents?: true

Size: 598 Bytes

Versions: 11

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

module Boppers
  module Notifier
    class Pushover
      ENDPOINT = "https://api.pushover.net/1/messages.json"

      attr_reader :app_token, :user_token, :subscribe

      def initialize(app_token:, user_token:, subscribe: nil)
        @app_token = app_token
        @user_token = user_token
        @subscribe = subscribe
      end

      def call(title, message, _options)
        HttpClient.post(
          ENDPOINT,
          token: app_token,
          user: user_token,
          title: title,
          message: message
        )
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
boppers-0.0.11 lib/boppers/notifier/pushover.rb
boppers-0.0.10 lib/boppers/notifier/pushover.rb
boppers-0.0.9 lib/boppers/notifier/pushover.rb
boppers-0.0.8 lib/boppers/notifier/pushover.rb
boppers-0.0.7 lib/boppers/notifier/pushover.rb
boppers-0.0.6 lib/boppers/notifier/pushover.rb
boppers-0.0.5 lib/boppers/notifier/pushover.rb
boppers-0.0.4 lib/boppers/notifier/pushover.rb
boppers-0.0.3 lib/boppers/notifier/pushover.rb
boppers-0.0.2 lib/boppers/notifier/pushover.rb
boppers-0.0.1 lib/boppers/notifier/pushover.rb