Class: WhatsappSdk::Resource::InteractiveActionSectionRow
- Inherits:
-
Object
- Object
- WhatsappSdk::Resource::InteractiveActionSectionRow
- Defined in:
- lib/whatsapp_sdk/resource/interactive_action_section_row.rb
Constant Summary collapse
- ACTION_SECTION_TITLE_MAXIMUM =
24
- ACTION_SECTION_DESCRIPTION_MAXIMUM =
72
- ACTION_SECTION_ID_MAXIMUM =
256
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the ActionSection description you want to send.
-
#id ⇒ Object
Returns the ActionSection unique identifier you want to send.
-
#title ⇒ Object
Returns the ActionSection title you want to send.
Instance Method Summary collapse
-
#initialize(title:, id:, description: "") ⇒ InteractiveActionSectionRow
constructor
A new instance of InteractiveActionSectionRow.
- #to_json ⇒ Object
Constructor Details
#initialize(title:, id:, description: "") ⇒ InteractiveActionSectionRow
Returns a new instance of InteractiveActionSectionRow.
26 27 28 29 30 31 |
# File 'lib/whatsapp_sdk/resource/interactive_action_section_row.rb', line 26 def initialize(title:, id:, description: "") @title = title @id = id @description = description validate end |
Instance Attribute Details
#description ⇒ Object
Returns the ActionSection description you want to send.
14 15 16 |
# File 'lib/whatsapp_sdk/resource/interactive_action_section_row.rb', line 14 def description @description end |
#id ⇒ Object
Returns the ActionSection unique identifier you want to send. This ID is returned in the webhook when the section is selected by the user.
20 21 22 |
# File 'lib/whatsapp_sdk/resource/interactive_action_section_row.rb', line 20 def id @id end |
#title ⇒ Object
Returns the ActionSection title you want to send.
9 10 11 |
# File 'lib/whatsapp_sdk/resource/interactive_action_section_row.rb', line 9 def title @title end |
Instance Method Details
#to_json ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/whatsapp_sdk/resource/interactive_action_section_row.rb', line 33 def to_json json = { id: id, title: title } json[:description] = description if description.length.positive? json end |