Class: MessengerClient::ButtonTemplate
- Inherits:
-
Object
- Object
- MessengerClient::ButtonTemplate
- Defined in:
- lib/messenger_client/button_template.rb
Instance Method Summary collapse
-
#initialize(text, buttons) ⇒ ButtonTemplate
constructor
A new instance of ButtonTemplate.
- #to_json ⇒ Object
Constructor Details
#initialize(text, buttons) ⇒ ButtonTemplate
Returns a new instance of ButtonTemplate.
3 4 5 6 |
# File 'lib/messenger_client/button_template.rb', line 3 def initialize(text, ) @text = text = () end |
Instance Method Details
#to_json ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/messenger_client/button_template.rb', line 8 def to_json { attachment: { type: "template", payload: { template_type: "button", text: @text, buttons: } } } end |