Sha256: 6fe311fc4727b3ce41e3523bd3f90648f2f06eda6be64ad2696992d85aff6484

Contents?: true

Size: 617 Bytes

Versions: 11

Compression:

Stored size: 617 Bytes

Contents

module Clicksign
  module API
    class WhatsappNotifier
      extend Requests

      REQUEST_PATH = '/api/v1/notify_by_whatsapp'
      ATTRIBUTES = [:request_signature_key]

      class << self
        def notify(token:, params: {})
          post(
            REQUEST_PATH,
            body(params),
            token
          )
        end

        def body(params)
          params = params.transform_keys(&:to_sym)

          ATTRIBUTES.each.with_object({}) do |attribute, hash|
            hash[attribute] = params[attribute] if params.has_key?(attribute)
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
clicksign-api-1.1.8.alpha lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.7.alpha lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.6.alpha lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.5.alpha lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.4.alpha lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.3.alpha lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.2.alpha lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.1 lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.0 lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.0.alpha6 lib/clicksign/api/whatsapp_notifier.rb
clicksign-api-1.1.0.alpha5 lib/clicksign/api/whatsapp_notifier.rb