Class: Whatsapp::Messages::Interactive::ListButtons::Section::Row
- Inherits:
-
Object
- Object
- Whatsapp::Messages::Interactive::ListButtons::Section::Row
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/ruby/whatsapp/messages/interactive/list_buttons/section/row.rb
Defined Under Namespace
Modules: Defaults
Instance Attribute Summary collapse
Class Method Summary collapse
-
.serialize(**row) ⇒ Hash
Serialized representation of the Row.
Instance Method Summary collapse
-
#initialize(id:, title:, description: nil) ⇒ Row
constructor
A new instance of Row.
-
#serialize ⇒ Hash
Serialized representation of the Row.
Constructor Details
#initialize(id:, title:, description: nil) ⇒ Row
Returns a new instance of Row.
37 38 39 40 41 42 43 |
# File 'lib/ruby/whatsapp/messages/interactive/list_buttons/section/row.rb', line 37 def initialize(id:, title:, description: nil) @id = id @title = title @description = description validate! end |
Instance Attribute Details
#description ⇒ String?
27 28 29 |
# File 'lib/ruby/whatsapp/messages/interactive/list_buttons/section/row.rb', line 27 def description @description end |
#id ⇒ String
19 20 21 |
# File 'lib/ruby/whatsapp/messages/interactive/list_buttons/section/row.rb', line 19 def id @id end |
#title ⇒ String
23 24 25 |
# File 'lib/ruby/whatsapp/messages/interactive/list_buttons/section/row.rb', line 23 def title @title end |
Class Method Details
.serialize(**row) ⇒ Hash
Returns Serialized representation of the Row. @raise [ActiveModel::ValidationError] if validation fails.
48 49 50 |
# File 'lib/ruby/whatsapp/messages/interactive/list_buttons/section/row.rb', line 48 def serialize(**row) new(**row).serialize end |
Instance Method Details
#serialize ⇒ Hash
Returns Serialized representation of the Row.
54 55 56 57 58 59 60 |
# File 'lib/ruby/whatsapp/messages/interactive/list_buttons/section/row.rb', line 54 def serialize { id:, title:, description:, }.compact end |