Class: Messenger::Templates::Buttons
- Inherits:
-
Object
- Object
- Messenger::Templates::Buttons
- Includes:
- Components::Attachment
- Defined in:
- lib/messenger/components/templates/buttons.rb
Constant Summary collapse
- ATTRIBUTES =
%w(template_type text buttons).freeze
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#template_type ⇒ Object
Returns the value of attribute template_type.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes included from Components::Attachment
Instance Method Summary collapse
-
#initialize(text:, buttons:) ⇒ Buttons
constructor
A new instance of Buttons.
Methods included from Components::Attachment
#all_attributes, #allowed_attribute?, #build, #build_elements, #payload
Constructor Details
#initialize(text:, buttons:) ⇒ Buttons
Returns a new instance of Buttons.
12 13 14 15 16 17 |
# File 'lib/messenger/components/templates/buttons.rb', line 12 def initialize(text:, buttons:) @type = 'template' @template_type = 'button' @text = text @buttons = build_elements() end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
8 9 10 |
# File 'lib/messenger/components/templates/buttons.rb', line 8 def @buttons end |
#template_type ⇒ Object
Returns the value of attribute template_type.
8 9 10 |
# File 'lib/messenger/components/templates/buttons.rb', line 8 def template_type @template_type end |
#text ⇒ Object
Returns the value of attribute text.
8 9 10 |
# File 'lib/messenger/components/templates/buttons.rb', line 8 def text @text end |