class MessengerPlatform::TextMessage

Constants

MAX_MESSAGE_LENGTH

Attributes

message[R]

Public Class Methods

new(recipient, message, notification_type = :regular) click to toggle source
Calls superclass method MessengerPlatform::MessageBase::new
# File lib/messenger_platform/text_message.rb, line 7
def initialize(recipient, message, notification_type = :regular)
  super(recipient, notification_type)
  @message = message.slice(0, MAX_MESSAGE_LENGTH)
end

Public Instance Methods

serialize() click to toggle source
# File lib/messenger_platform/text_message.rb, line 12
def serialize
  super.merge({
    message: {
      text: message
    }
  })
end