class FamilyappSdk::Components::Template
Attributes
elements_attributes[RW]
template_type[RW]
Public Class Methods
new(type:, elements: nil, buttons: nil)
click to toggle source
# File lib/familyapp_sdk/components/template.rb, line 6 def initialize(type:, elements: nil, buttons: nil) @template_type = type @elements_attributes = build_attributes(elements) @buttons_attributes = build_attributes(buttons) end
Public Instance Methods
build()
click to toggle source
# File lib/familyapp_sdk/components/template.rb, line 12 def build instance_values.delete_if { |_attribute, value| value.nil? } end
build_attributes(attributes)
click to toggle source
# File lib/familyapp_sdk/components/template.rb, line 16 def build_attributes(attributes) attributes.map(&:build) if attributes.present? end