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.



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

#categoryObject (readonly)

Returns the value of attribute category.



826
827
828
# File 'lib/sendly/types.rb', line 826

def category
  @category
end

#nameObject (readonly)

Returns the value of attribute name.



826
827
828
# File 'lib/sendly/types.rb', line 826

def name
  @name
end

#textObject (readonly)

Returns the value of attribute text.



826
827
828
# File 'lib/sendly/types.rb', line 826

def text
  @text
end

#variablesObject (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_hObject



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