Class: FamilyappSdk::Components::Templates
- Inherits:
-
Object
- Object
- FamilyappSdk::Components::Templates
- Defined in:
- lib/familyapp_sdk/components/template.rb
Instance Attribute Summary collapse
-
#buttons_attributes ⇒ Object
Returns the value of attribute buttons_attributes.
-
#elements_attributes ⇒ Object
Returns the value of attribute elements_attributes.
-
#template_type ⇒ Object
Returns the value of attribute template_type.
Instance Method Summary collapse
- #build ⇒ Object
- #build_attributes(attributes) ⇒ Object
-
#initialize(type:, elements: nil, buttons: nil) ⇒ Templates
constructor
A new instance of Templates.
Constructor Details
#initialize(type:, elements: nil, buttons: nil) ⇒ Templates
Returns a new instance of Templates.
6 7 8 9 10 |
# File 'lib/familyapp_sdk/components/template.rb', line 6 def initialize(type:, elements: nil, buttons: nil) @template_type = type @elements_attributes = build_attributes(elements) = build_attributes() end |
Instance Attribute Details
#buttons_attributes ⇒ Object
Returns the value of attribute buttons_attributes.
4 5 6 |
# File 'lib/familyapp_sdk/components/template.rb', line 4 def end |
#elements_attributes ⇒ Object
Returns the value of attribute elements_attributes.
4 5 6 |
# File 'lib/familyapp_sdk/components/template.rb', line 4 def elements_attributes @elements_attributes end |
#template_type ⇒ Object
Returns the value of attribute template_type.
4 5 6 |
# File 'lib/familyapp_sdk/components/template.rb', line 4 def template_type @template_type end |
Instance Method Details
#build ⇒ Object
12 13 14 |
# File 'lib/familyapp_sdk/components/template.rb', line 12 def build instance_values.delete_if { |_attribute, value| value.nil? } end |
#build_attributes(attributes) ⇒ Object
16 17 18 |
# File 'lib/familyapp_sdk/components/template.rb', line 16 def build_attributes(attributes) attributes.map(&:build) if attributes.present? end |