Class: Whatsapp::Messages::Interactive::ProductCarousel
- Defined in:
- lib/ruby/whatsapp/messages/interactive/product_carousel.rb,
lib/ruby/whatsapp/messages/interactive/product_carousel/card.rb
Defined Under Namespace
Modules: Defaults Classes: Card
Instance Attribute Summary collapse
Class Method Summary collapse
-
.serialize(cards:) ⇒ Hash
Serialized representation of the ProductCarousel.
Instance Method Summary collapse
-
#initialize(cards:) ⇒ ProductCarousel
constructor
A new instance of ProductCarousel.
-
#serialize ⇒ Hash
Serialized representation of the ProductCarousel.
Constructor Details
#initialize(cards:) ⇒ ProductCarousel
Returns a new instance of ProductCarousel.
20 21 22 23 24 |
# File 'lib/ruby/whatsapp/messages/interactive/product_carousel.rb', line 20 def initialize(cards:) @cards = cards validate! end |
Instance Attribute Details
#cards ⇒ Array<Hash>
14 15 16 |
# File 'lib/ruby/whatsapp/messages/interactive/product_carousel.rb', line 14 def cards @cards end |
Class Method Details
.serialize(cards:) ⇒ Hash
Returns Serialized representation of the ProductCarousel.
28 29 30 |
# File 'lib/ruby/whatsapp/messages/interactive/product_carousel.rb', line 28 def serialize(cards:) new(cards:).serialize end |
Instance Method Details
#serialize ⇒ Hash
Returns Serialized representation of the ProductCarousel.
34 35 36 37 38 |
# File 'lib/ruby/whatsapp/messages/interactive/product_carousel.rb', line 34 def serialize { cards: serialized_cards, } end |