class Whats::Actions::SendMessage

Constants

PATH

Attributes

body[R]
client[R]
wa_id[R]

Public Class Methods

new(client, wa_id, body) click to toggle source
# File lib/whats/actions/send_message.rb, line 8
def initialize(client, wa_id, body)
  @client = client
  @wa_id  = wa_id
  @body   = body
end

Public Instance Methods

call() click to toggle source
# File lib/whats/actions/send_message.rb, line 14
def call
  client.request PATH, payload
end

Private Instance Methods

payload() click to toggle source
# File lib/whats/actions/send_message.rb, line 22
def payload
  {
    recipient_type: "individual",
    to: wa_id,
    type: "text",
    text: {
      body: body
    }
  }
end