Class: Whatsapp::Webhook::Message::Document
- Defined in:
- lib/ruby/whatsapp/webhook/message/document.rb
Overview
An inbound document message.
Instance Attribute Summary collapse
Attributes inherited from Media
#caption, #media_id, #mime_type, #sha256
Attributes inherited from Base
#context, #from, #id, #referral, #timestamp, #type
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename: nil, **media_and_base_attributes) ⇒ Document
constructor
A new instance of Document.
Methods inherited from Media
Methods inherited from Base
Constructor Details
#initialize(filename: nil, **media_and_base_attributes) ⇒ Document
Returns a new instance of Document.
12 13 14 15 16 |
# File 'lib/ruby/whatsapp/webhook/message/document.rb', line 12 def initialize(filename: nil, **media_and_base_attributes) super(**media_and_base_attributes) @filename = filename end |
Instance Attribute Details
#filename ⇒ String?
10 11 12 |
# File 'lib/ruby/whatsapp/webhook/message/document.rb', line 10 def filename @filename end |
Class Method Details
.deserialize(data) ⇒ Document
21 22 23 24 25 26 27 |
# File 'lib/ruby/whatsapp/webhook/message/document.rb', line 21 def deserialize(data) new( filename: data.dig("document", "filename"), **media_attributes(data, "document"), **common_attributes(data) ) end |