Class: Whatsapp::Webhook::Message::Referral
- Inherits:
-
Object
- Object
- Whatsapp::Webhook::Message::Referral
- Defined in:
- lib/ruby/whatsapp/webhook/message/referral.rb
Overview
Present when an inbound message originated from a Click-to-WhatsApp ad or a post/story with an embedded WhatsApp link.
Instance Attribute Summary collapse
- #body ⇒ String?
- #headline ⇒ String?
- #image_url ⇒ String?
- #media_type ⇒ String?
- #source_id ⇒ String?
- #source_type ⇒ String?
- #source_url ⇒ String?
- #thumbnail_url ⇒ String?
- #video_url ⇒ String?
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source_url:, source_type:, source_id:, headline:, body:, media_type:, image_url: nil, video_url: nil, thumbnail_url: nil) ⇒ Referral
constructor
A new instance of Referral.
Constructor Details
#initialize(source_url:, source_type:, source_id:, headline:, body:, media_type:, image_url: nil, video_url: nil, thumbnail_url: nil) ⇒ Referral
Returns a new instance of Referral.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 45 def initialize(source_url:, source_type:, source_id:, headline:, body:, media_type:, image_url: nil, video_url: nil, thumbnail_url: nil) @source_url = source_url @source_type = source_type @source_id = source_id @headline = headline @body = body @media_type = media_type @image_url = image_url @video_url = video_url @thumbnail_url = thumbnail_url end |
Instance Attribute Details
#body ⇒ String?
27 28 29 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 27 def body @body end |
#headline ⇒ String?
23 24 25 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 23 def headline @headline end |
#image_url ⇒ String?
35 36 37 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 35 def image_url @image_url end |
#media_type ⇒ String?
31 32 33 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 31 def media_type @media_type end |
#source_id ⇒ String?
19 20 21 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 19 def source_id @source_id end |
#source_type ⇒ String?
15 16 17 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 15 def source_type @source_type end |
#source_url ⇒ String?
11 12 13 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 11 def source_url @source_url end |
#thumbnail_url ⇒ String?
43 44 45 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 43 def thumbnail_url @thumbnail_url end |
#video_url ⇒ String?
39 40 41 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 39 def video_url @video_url end |
Class Method Details
.deserialize(data) ⇒ Referral?
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/ruby/whatsapp/webhook/message/referral.rb', line 61 def deserialize(data) return if data.nil? new( source_url: data["source_url"], source_type: data["source_type"], source_id: data["source_id"], headline: data["headline"], body: data["body"], media_type: data["media_type"], image_url: data["image_url"], video_url: data["video_url"], thumbnail_url: data["thumbnail_url"] ) end |