Class: PostProxy::MessageButton
Overview
A button attached to the message, delivered as a Meta generic template.
Facebook and Instagram only; up to 3 per send. url is required and must be
https when type is "web_url"; payload is required when type is
"postback". type is a plain string rather than an enum so a new Meta
button type needs no SDK release.
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.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ MessageButton
constructor
A new instance of MessageButton.
- #to_h ⇒ Object
Constructor Details
#initialize(**attrs) ⇒ MessageButton
Returns a new instance of MessageButton.
456 457 458 459 460 |
# File 'lib/postproxy/types.rb', line 456 def initialize(**attrs) @url = nil @payload = nil super end |
Instance Attribute Details
#payload ⇒ Object
Returns the value of attribute payload.
454 455 456 |
# File 'lib/postproxy/types.rb', line 454 def payload @payload end |
#title ⇒ Object
Returns the value of attribute title.
454 455 456 |
# File 'lib/postproxy/types.rb', line 454 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
454 455 456 |
# File 'lib/postproxy/types.rb', line 454 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
454 455 456 |
# File 'lib/postproxy/types.rb', line 454 def url @url end |
Instance Method Details
#to_h ⇒ Object
462 463 464 |
# File 'lib/postproxy/types.rb', line 462 def to_h { type: @type, title: @title, url: @url, payload: @payload }.compact end |