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