Class: Fb::Messenger::Template::Generic
- Inherits:
-
Object
- Object
- Fb::Messenger::Template::Generic
- Defined in:
- lib/fb/messenger/templates/generic.rb
Overview
generic template
Instance Attribute Summary collapse
-
#generic_items ⇒ Object
Returns the value of attribute generic_items.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Generic
constructor
A new instance of Generic.
- #template ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Generic
Returns a new instance of Generic.
8 9 10 |
# File 'lib/fb/messenger/templates/generic.rb', line 8 def initialize(opts = {}) @generic_items = opts[:generic_items] || [] end |
Instance Attribute Details
#generic_items ⇒ Object
Returns the value of attribute generic_items.
6 7 8 |
# File 'lib/fb/messenger/templates/generic.rb', line 6 def generic_items @generic_items end |
Instance Method Details
#template ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fb/messenger/templates/generic.rb', line 12 def template { attachment: { type: 'template', payload: { template_type: 'generic', elements: generic_items.map(&:template) } } } end |