Sha256: c40cbe36763ab1ee11626edfa53390a9d9f6b72b8d3d7b961bc7e51e1ec670d7

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

# require 'pushover'

module Legion::Extensions::Pushover
  module Runners
    module Message
      include Legion::Extensions::Pushover::Helpers::Client

      def push(message:, title: nil, **opts)
        result = message(message: message, title: title, **opts).push
        raise IOError, result.errors unless result.errors.nil?

        {}
      end

      def emergency(message:, title: nil, **opts)
        result = message(message: message, title: title, **opts).push
        raise IOError, result.errors unless result.errors.nil?

        {}
      end

      def high(message:, title: nil, **opts)
        result = message(message: message, title: title, **opts).push
        raise IOError, result.errors unless result.errors.nil?

        {}
      end

      def normal(message:, title: nil, **opts)
        result = message(message: message, title: title, **opts).push
        raise IOError, result.errors unless result.errors.nil?

        {}
      end

      def low(message:, title: nil, **opts)
        result = message(message: message, title: title, **opts).push
        raise IOError, result.errors unless result.errors.nil?

        {}
      end

      def lowest(message:, title: nil, **opts)
        result = message(message: message, title: title, **opts).push
        raise IOError, result.errors unless result.errors.nil?

        {}
      end

      include Legion::Extensions::Helpers::Lex
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lex-pushover-0.1.1 lib/legion/extensions/pushover/runners/message.rb
lex-pushover-0.1.0 lib/legion/extensions/pushover/runners/message.rb