Class: Sendly::GeneratedTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/types.rb

Overview

============================================================================

Generated Template

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ GeneratedTemplate

Returns a new instance of GeneratedTemplate.



976
977
978
979
980
981
# File 'lib/sendly/types.rb', line 976

def initialize(data)
  @name = data["name"]
  @text = data["text"]
  @variables = data["variables"] || []
  @category = data["category"]
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



974
975
976
# File 'lib/sendly/types.rb', line 974

def category
  @category
end

#nameObject (readonly)

Returns the value of attribute name.



974
975
976
# File 'lib/sendly/types.rb', line 974

def name
  @name
end

#textObject (readonly)

Returns the value of attribute text.



974
975
976
# File 'lib/sendly/types.rb', line 974

def text
  @text
end

#variablesObject (readonly)

Returns the value of attribute variables.



974
975
976
# File 'lib/sendly/types.rb', line 974

def variables
  @variables
end

Instance Method Details

#to_hObject



983
984
985
986
987
# File 'lib/sendly/types.rb', line 983

def to_h
  {
    name: name, text: text, variables: variables, category: category
  }.compact
end