Class: Sendly::GeneratedTemplate
- Inherits:
-
Object
- Object
- Sendly::GeneratedTemplate
- Defined in:
- lib/sendly/types.rb
Overview
Generated Template
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
-
#initialize(data) ⇒ GeneratedTemplate
constructor
A new instance of GeneratedTemplate.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ GeneratedTemplate
Returns a new instance of GeneratedTemplate.
828 829 830 831 832 833 |
# File 'lib/sendly/types.rb', line 828 def initialize(data) @name = data["name"] @text = data["text"] @variables = data["variables"] || [] @category = data["category"] end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
826 827 828 |
# File 'lib/sendly/types.rb', line 826 def category @category end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
826 827 828 |
# File 'lib/sendly/types.rb', line 826 def name @name end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
826 827 828 |
# File 'lib/sendly/types.rb', line 826 def text @text end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
826 827 828 |
# File 'lib/sendly/types.rb', line 826 def variables @variables end |
Instance Method Details
#to_h ⇒ Object
835 836 837 838 839 |
# File 'lib/sendly/types.rb', line 835 def to_h { name: name, text: text, variables: variables, category: category }.compact end |