Class: UI::FBOpenGraphTemplate

Inherits:
BaseUiElement show all
Includes:
Common::HasButtons
Defined in:
lib/ui/fb_open_graph_template.rb

Overview

Instance Method Summary collapse

Methods inherited from BaseUiElement

#build, #send

Constructor Details

#initialize(url, buttons = []) ⇒ FBOpenGraphTemplate

Returns a new instance of FBOpenGraphTemplate.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ui/fb_open_graph_template.rb', line 9

def initialize(url, buttons = [])
  @url = url
  @buttons = buttons

  @template = {
    recipient: {
      id: nil
    },
    message: {
      attachment: {
        type: 'template',
        payload: {
          template_type: 'open_graph',
          elements: elements
        }
      }
    }
  }
end