Class: Messenger::Templates::Buttons

Inherits:
Components::Attachment show all
Defined in:
lib/messenger/components/templates/buttons.rb

Constant Summary collapse

ATTRIBUTES =
%w(template_type text buttons).freeze

Instance Method Summary collapse

Methods inherited from Components::Attachment

#all_attributes, #allowed_attribute?, #build, #build_elements, #payload

Constructor Details

#initialize(text:, buttons:) ⇒ Buttons

Returns a new instance of Buttons.



8
9
10
11
12
13
# File 'lib/messenger/components/templates/buttons.rb', line 8

def initialize(text:, buttons:)
  @type = 'template'
  @template_type = 'button'
  @text = text
  @buttons = build_elements(buttons)
end