Class: WhatsappSdk::Resource::InteractiveActionReplyButton
- Inherits:
-
Object
- Object
- WhatsappSdk::Resource::InteractiveActionReplyButton
- Defined in:
- lib/whatsapp_sdk/resource/interactive_action_reply_button.rb
Defined Under Namespace
Modules: Type
Constant Summary collapse
- ACTION_BUTTON_TITLE_MAXIMUM =
20
- ACTION_BUTTON_ID_MAXIMUM =
256
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the ActionButton unique identifier you want to send.
-
#title ⇒ Object
Returns the ActionButton title you want to send.
-
#type ⇒ Object
Returns the ActionButton type of message you want to send.
Instance Method Summary collapse
-
#initialize(title:, id:) ⇒ InteractiveActionReplyButton
constructor
A new instance of InteractiveActionReplyButton.
- #to_json ⇒ Object
Constructor Details
#initialize(title:, id:) ⇒ InteractiveActionReplyButton
29 30 31 32 33 34 |
# File 'lib/whatsapp_sdk/resource/interactive_action_reply_button.rb', line 29 def initialize(title:, id:) @type = Type::REPLY @title = title @id = id validate end |
Instance Attribute Details
#id ⇒ Object
Returns the ActionButton unique identifier you want to send. This ID is returned in the webhook when the button is clicked by the user.
24 25 26 |
# File 'lib/whatsapp_sdk/resource/interactive_action_reply_button.rb', line 24 def id @id end |
#title ⇒ Object
Returns the ActionButton title you want to send.
18 19 20 |
# File 'lib/whatsapp_sdk/resource/interactive_action_reply_button.rb', line 18 def title @title end |
#type ⇒ Object
Returns the ActionButton type of message you want to send.
13 14 15 |
# File 'lib/whatsapp_sdk/resource/interactive_action_reply_button.rb', line 13 def type @type end |
Instance Method Details
#to_json ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/whatsapp_sdk/resource/interactive_action_reply_button.rb', line 36 def to_json json = { type: type } json[type.to_sym] = { id: id, title: title } json end |