Class: Whatsapp::Messages::Interactive::MediaCarousel::Card::Button::QuickReply

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/ruby/whatsapp/messages/interactive/media_carousel/card/button/quick_reply.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, title:) ⇒ QuickReply

Returns a new instance of QuickReply.

Parameters:

  • id (String)

    The ID of the quick reply button.

  • title (String)

    The title of the quick reply button.



25
26
27
28
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card/button/quick_reply.rb', line 25

def initialize(id:, title:)
  @id = id
  @title = title
end

Instance Attribute Details

#idString

Returns:

  • (String)


14
15
16
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card/button/quick_reply.rb', line 14

def id
  @id
end

#titleString

Returns:

  • (String)


18
19
20
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card/button/quick_reply.rb', line 18

def title
  @title
end

Class Method Details

.serialize(id:, title:) ⇒ Hash

Returns Serialized representation of the QuickReply.

Returns:

  • (Hash)

    Serialized representation of the QuickReply.



32
33
34
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card/button/quick_reply.rb', line 32

def serialize(id:, title:)
  new(id:, title:).serialize
end

Instance Method Details

#serializeHash

Returns Serialized representation of the QuickReply.

Returns:

  • (Hash)

    Serialized representation of the QuickReply.



38
39
40
41
42
43
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card/button/quick_reply.rb', line 38

def serialize
  {
    id:,
    title:,
  }
end