Class: UI::FBButtonTemplate

Inherits:
BaseUiElement show all
Defined in:
lib/ui/fb_button_template.rb

Overview

Instance Method Summary collapse

Methods inherited from BaseUiElement

#build, #send

Constructor Details

#initialize(text, buttons) ⇒ FBButtonTemplate

Returns a new instance of FBButtonTemplate.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ui/fb_button_template.rb', line 7

def initialize(text, buttons)
  @template = {
    recipient: {
      id: nil
    },
    message: {
      attachment: {
        type: 'template',
        payload: {
          template_type: 'button',
          text: text,
          buttons: parse_buttons(buttons)
        }
      }
    }
  }
end