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.
897 898 899 900 901 902 |
# File 'lib/sendly/types.rb', line 897 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.
895 896 897 |
# File 'lib/sendly/types.rb', line 895 def category @category end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
895 896 897 |
# File 'lib/sendly/types.rb', line 895 def name @name end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
895 896 897 |
# File 'lib/sendly/types.rb', line 895 def text @text end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
895 896 897 |
# File 'lib/sendly/types.rb', line 895 def variables @variables end |
Instance Method Details
#to_h ⇒ Object
904 905 906 907 908 |
# File 'lib/sendly/types.rb', line 904 def to_h { name: name, text: text, variables: variables, category: category }.compact end |