Class: Fabychy::DataTypes::ButtonTemplatePayload

Inherits:
Payload
  • Object
show all
Defined in:
lib/fabychy/data_types/button_template_payload.rb

Instance Method Summary collapse

Constructor Details

#initialize(*params) ⇒ ButtonTemplatePayload

Returns a new instance of ButtonTemplatePayload.



6
7
8
9
# File 'lib/fabychy/data_types/button_template_payload.rb', line 6

def initialize *params
  super(*params)
  @template_type = 'button'
end

Instance Method Details

#validationsObject



11
12
13
14
15
16
17
18
# File 'lib/fabychy/data_types/button_template_payload.rb', line 11

def validations
  super.merge(
    {
      text: {required: false, drop_empty: true, class: [String] },
      buttons: {required: true, class: [Array], inner_class: [Button] }
    }
  )
end