Class: Messenger::Templates::Generic

Inherits:
Object
  • Object
show all
Includes:
Components::Attachment
Defined in:
lib/messenger/components/templates/generic.rb

Constant Summary collapse

ATTRIBUTES =
%w(template_type elements).freeze

Instance Attribute Summary collapse

Attributes included from Components::Attachment

#type

Instance Method Summary collapse

Methods included from Components::Attachment

#all_attributes, #allowed_attribute?, #build, #build_elements, #payload

Constructor Details

#initialize(elements:) ⇒ Generic

Returns a new instance of Generic.



12
13
14
15
16
# File 'lib/messenger/components/templates/generic.rb', line 12

def initialize(elements:)
  @type          = 'template'
  @template_type = 'generic'
  @elements      = build_elements(elements)
end

Instance Attribute Details

#elementsObject

Returns the value of attribute elements.



8
9
10
# File 'lib/messenger/components/templates/generic.rb', line 8

def elements
  @elements
end

#template_typeObject

Returns the value of attribute template_type.



8
9
10
# File 'lib/messenger/components/templates/generic.rb', line 8

def template_type
  @template_type
end