Class: Whatsapp::Messages::Interactive::MediaCarousel::Card
- Inherits:
-
Object
- Object
- Whatsapp::Messages::Interactive::MediaCarousel::Card
show all
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/ruby/whatsapp/messages/interactive/media_carousel/card.rb,
lib/ruby/whatsapp/messages/interactive/media_carousel/card/button.rb,
lib/ruby/whatsapp/messages/interactive/media_carousel/card/button/quick_reply.rb
Defined Under Namespace
Modules: Defaults
Classes: Button
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(card_index:, header:, body:, action:, buttons:) ⇒ Card
Returns a new instance of Card.
40
41
42
43
44
45
46
47
48
|
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card.rb', line 40
def initialize(card_index:, header:, body:, action:, buttons:)
@card_index = card_index
@header =
@body = body
@action = action
@buttons = buttons
validate!
end
|
Instance Attribute Details
#action ⇒ Hash
28
29
30
|
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card.rb', line 28
def action
@action
end
|
#body ⇒ String
24
25
26
|
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card.rb', line 24
def body
@body
end
|
32
33
34
|
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card.rb', line 32
def buttons
@buttons
end
|
#card_index ⇒ Integer
16
17
18
|
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card.rb', line 16
def card_index
@card_index
end
|
20
21
22
|
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card.rb', line 20
def
@header
end
|
Class Method Details
.serialize(card_index:, header:, body:, action:, buttons:) ⇒ Hash
Returns Serialized representation of the Card.
52
53
54
|
# File 'lib/ruby/whatsapp/messages/interactive/media_carousel/card.rb', line 52
def serialize(card_index:, header:, body:, action:, buttons:)
new(card_index:, header:, body:, action:, buttons:).serialize
end
|
Instance Method Details
#serialize ⇒ Hash
Returns Serialized representation of the Card.