Class: MessengerPlatform::TextMessage
- Inherits:
-
MessageBase
- Object
- MessageBase
- MessengerPlatform::TextMessage
- Defined in:
- lib/messenger_platform/text_message.rb
Constant Summary collapse
- MAX_MESSAGE_LENGTH =
320
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Attributes inherited from MessageBase
#notification_type, #recipient
Instance Method Summary collapse
-
#initialize(recipient, message, notification_type = :regular) ⇒ TextMessage
constructor
A new instance of TextMessage.
- #serialize ⇒ Object
Methods inherited from MessageBase
Constructor Details
#initialize(recipient, message, notification_type = :regular) ⇒ TextMessage
Returns a new instance of TextMessage.
7 8 9 10 |
# File 'lib/messenger_platform/text_message.rb', line 7 def initialize(recipient, , notification_type = :regular) super(recipient, notification_type) @message = .slice(0, MAX_MESSAGE_LENGTH) end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/messenger_platform/text_message.rb', line 5 def @message end |
Instance Method Details
#serialize ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/messenger_platform/text_message.rb', line 12 def serialize super.merge({ message: { text: } }) end |