Class: WhatsAppCloudApi::Footer

Inherits:
BaseModel show all
Defined in:
lib/whats_app_cloud_api/models/footer.rb

Overview

Footer Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(text = nil) ⇒ Footer

Returns a new instance of Footer.



34
35
36
# File 'lib/whats_app_cloud_api/models/footer.rb', line 34

def initialize(text = nil)
  @text = text unless text == SKIP
end

Instance Attribute Details

#textString

The footer content. Emojis and markdown are supported. Links are supported.

Returns:

  • (String)


15
16
17
# File 'lib/whats_app_cloud_api/models/footer.rb', line 15

def text
  @text
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



39
40
41
42
43
44
45
46
47
# File 'lib/whats_app_cloud_api/models/footer.rb', line 39

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  text = hash.key?('text') ? hash['text'] : SKIP

  # Create object from extracted values.

  Footer.new(text)
end

.namesObject

A mapping from model property names to API property names.



18
19
20
21
22
# File 'lib/whats_app_cloud_api/models/footer.rb', line 18

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['text'] = 'text'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



30
31
32
# File 'lib/whats_app_cloud_api/models/footer.rb', line 30

def nullables
  []
end

#optionalsObject

An array for optional fields



25
26
27
# File 'lib/whats_app_cloud_api/models/footer.rb', line 25

def optionals
  []
end