Sha256: d235f900d4c9ded7facd8d5dfcb747408c0b5e186091011f06141e569a8ae1f7

Contents?: true

Size: 720 Bytes

Versions: 11

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

module Boppers
  module Notifier
    class Hipchat
      attr_reader :api_token, :room

      def initialize(api_token:, room:, subscribe: nil)
        @api_token = api_token
        @room = room
        @subscribe = subscribe
      end

      def call(title, message, options)
        endpoint = "https://api.hipchat.com/v2/room/#{room}/notification"
        HttpClient.post(endpoint,
                        message_format: "text",
                        color: options.fetch(:color, "gray"),
                        notify: true,
                        message: message,
                        title: title,
                        auth_token: api_token)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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