Class: Fb::Messenger::Template::GenericItem
- Inherits:
-
Object
- Object
- Fb::Messenger::Template::GenericItem
- Defined in:
- lib/fb/messenger/templates/generic_item.rb
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#subtitle ⇒ Object
Returns the value of attribute subtitle.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ GenericItem
constructor
A new instance of GenericItem.
- #template ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ GenericItem
Returns a new instance of GenericItem.
7 8 9 10 11 12 |
# File 'lib/fb/messenger/templates/generic_item.rb', line 7 def initialize(opts = {}) @title = opts[:title] @subtitle = opts[:subtitle] @image_url = opts[:image_url] @buttons = opts[:buttons] || [] end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
5 6 7 |
# File 'lib/fb/messenger/templates/generic_item.rb', line 5 def @buttons end |
#image_url ⇒ Object
Returns the value of attribute image_url.
5 6 7 |
# File 'lib/fb/messenger/templates/generic_item.rb', line 5 def image_url @image_url end |
#subtitle ⇒ Object
Returns the value of attribute subtitle.
5 6 7 |
# File 'lib/fb/messenger/templates/generic_item.rb', line 5 def subtitle @subtitle end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/fb/messenger/templates/generic_item.rb', line 5 def title @title end |
Instance Method Details
#template ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/fb/messenger/templates/generic_item.rb', line 14 def template { title: title, subtitle: subtitle, image_url: image_url, buttons: .map(&:template) } end |