Class: MessengerClient::QuickReply
- Inherits:
-
Object
- Object
- MessengerClient::QuickReply
- Defined in:
- lib/messenger_client/quick_reply.rb
Instance Method Summary collapse
-
#initialize(text, payload = nil, image_url = nil) ⇒ QuickReply
constructor
A new instance of QuickReply.
- #to_json ⇒ Object
Constructor Details
#initialize(text, payload = nil, image_url = nil) ⇒ QuickReply
Returns a new instance of QuickReply.
3 4 5 6 7 |
# File 'lib/messenger_client/quick_reply.rb', line 3 def initialize(text, payload=nil, image_url=nil) @text = text @payload = payload @image_url = image_url end |
Instance Method Details
#to_json ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/messenger_client/quick_reply.rb', line 9 def to_json json = { content_type: "text", title: @text } json.merge!(payload: @payload) unless @payload.nil? json.merge!(image_url: @image_url) unless @image_url.nil? json end |