Class: SendgridTemplateEngine::Version

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#activeObject

Returns the value of attribute active.



62
63
64
# File 'lib/versions.rb', line 62

def active
  @active
end

#html_contentObject

Returns the value of attribute html_content.



62
63
64
# File 'lib/versions.rb', line 62

def html_content
  @html_content
end

#idObject

Returns the value of attribute id.



62
63
64
# File 'lib/versions.rb', line 62

def id
  @id
end

#nameObject

Returns the value of attribute name.



62
63
64
# File 'lib/versions.rb', line 62

def name
  @name
end

#plain_contentObject

Returns the value of attribute plain_content.



62
63
64
# File 'lib/versions.rb', line 62

def plain_content
  @plain_content
end

#subjectObject

Returns the value of attribute subject.



62
63
64
# File 'lib/versions.rb', line 62

def subject
  @subject
end

#template_idObject

Returns the value of attribute template_id.



62
63
64
# File 'lib/versions.rb', line 62

def template_id
  @template_id
end

#updated_atObject

Returns the value of attribute updated_at.



62
63
64
# File 'lib/versions.rb', line 62

def updated_at
  @updated_at
end

Class Method Details

.create(value) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/versions.rb', line 64

def self.create(value)
  obj = Version.new
  obj.id = value["id"]
  obj.template_id = value["template_id"]
  obj.active = value["active"]
  obj.name = value["name"]
  obj.html_content = value["html_content"]
  obj.plain_content = value["plain_content"]
  obj.subject = value["subject"]
  obj.updated_at = value["updated_at"]
  obj
end

Instance Method Details

#set_active(active) ⇒ Object



108
109
110
111
# File 'lib/versions.rb', line 108

def set_active(active)
  @active = active
  self
end

#set_html_content(html_content) ⇒ Object



98
99
100
101
# File 'lib/versions.rb', line 98

def set_html_content(html_content)
  @html_content = html_content
  self
end

#set_name(name) ⇒ Object



88
89
90
91
# File 'lib/versions.rb', line 88

def set_name(name)
  @name = name
  self
end

#set_plain_content(plain_content) ⇒ Object



103
104
105
106
# File 'lib/versions.rb', line 103

def set_plain_content(plain_content)
  @plain_content = plain_content
  self
end

#set_subject(subject) ⇒ Object



93
94
95
96
# File 'lib/versions.rb', line 93

def set_subject(subject)
  @subject = subject
  self
end

#to_hashObject



77
78
79
80
81
82
83
84
85
86
# File 'lib/versions.rb', line 77

def to_hash
  hash = {
    "active" => @active,
    "name" => @name,
    "html_content" => @html_content,
    "plain_content" => @plain_content,
    "subject" => @subject,
  }
  hash
end