Class: Whatsapp::Messages::Text
- Defined in:
- lib/ruby/whatsapp/messages/text.rb
Overview
Text messages are messages containing only a text body and an optional link preview. Source: https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/text-messages
Defined Under Namespace
Modules: Defaults
Instance Attribute Summary collapse
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(body:, preview_url: true) ⇒ Text
constructor
A new instance of Text.
-
#serialize ⇒ Hash
Serializes the text message to a hash format suitable for the WhatsApp API.
Constructor Details
#initialize(body:, preview_url: true) ⇒ Text
Returns a new instance of Text.
27 28 29 30 31 32 33 34 |
# File 'lib/ruby/whatsapp/messages/text.rb', line 27 def initialize(body:, preview_url: true, **) super(**) @body = body @preview_url = preview_url validate! end |
Instance Attribute Details
#body ⇒ String
14 15 16 |
# File 'lib/ruby/whatsapp/messages/text.rb', line 14 def body @body end |
#preview_url ⇒ Boolean
18 19 20 |
# File 'lib/ruby/whatsapp/messages/text.rb', line 18 def preview_url @preview_url end |