Class: Whatsapp::Messages::Interactive::Footer

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby/whatsapp/messages/interactive/footer.rb

Defined Under Namespace

Modules: Defaults

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Footer

Returns a new instance of Footer.

Parameters:

  • text (String)

    The footer text.



18
19
20
21
22
# File 'lib/ruby/whatsapp/messages/interactive/footer.rb', line 18

def initialize(text)
  @text = text

  validate!
end

Instance Attribute Details

#textString

Returns:

  • (String)


13
14
15
# File 'lib/ruby/whatsapp/messages/interactive/footer.rb', line 13

def text
  @text
end

Class Method Details

.serialize(text:) ⇒ Hash

Returns Serialized representation of the Header.

Returns:

  • (Hash)

    Serialized representation of the Header.



26
27
28
# File 'lib/ruby/whatsapp/messages/interactive/footer.rb', line 26

def serialize(text:)
  new(text).serialize
end

Instance Method Details

#serializeHash

Returns Serialized representation of the Header.

Returns:

  • (Hash)

    Serialized representation of the Header.



32
33
34
35
36
# File 'lib/ruby/whatsapp/messages/interactive/footer.rb', line 32

def serialize
  {
    text:,
  }
end