Sha256: 55f146891b3763a7be0c4da7dcb34e60ccfdd1a152b69a854fdcfc6e49a9a26c

Contents?: true

Size: 528 Bytes

Versions: 4

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true

module Whats
  module Actions
    class SendMessage
      PATH = "/api/rest_send.php"

      def initialize(client, username, body)
        @client   = client
        @username = username
        @body     = body
      end

      def call
        client.request PATH, payload
      end

      private

      attr_reader :client, :username, :body

      def payload
        {
          payload: {
            to:   username,
            body: body
          }
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
whatsapp-0.1.3 lib/whats/actions/send_message.rb
whatsapp-0.1.2 lib/whats/actions/send_message.rb
whatsapp-0.1.1 lib/whats/actions/send_message.rb
whatsapp-0.1.0 lib/whats/actions/send_message.rb