Class: UniOne::Template
- Inherits:
-
Object
- Object
- UniOne::Template
- Defined in:
- lib/unione/helpers/template/template.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
Returns the value of attribute attachments.
-
#body ⇒ Object
Returns the value of attribute body.
-
#from ⇒ Object
Returns the value of attribute from.
-
#global_substitutions ⇒ Object
Returns the value of attribute global_substitutions.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#inline_attachments ⇒ Object
Returns the value of attribute inline_attachments.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#template_engine ⇒ Object
Returns the value of attribute template_engine.
Instance Method Summary collapse
-
#initialize ⇒ Template
constructor
A new instance of Template.
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ Template
Returns a new instance of Template.
6 7 8 9 10 11 |
# File 'lib/unione/helpers/template/template.rb', line 6 def initialize @global_substitutions = {} @from = {} = [] = [] end |
Instance Attribute Details
#attachments ⇒ Object
Returns the value of attribute attachments.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def end |
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def body @body end |
#from ⇒ Object
Returns the value of attribute from.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def from @from end |
#global_substitutions ⇒ Object
Returns the value of attribute global_substitutions.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def global_substitutions @global_substitutions end |
#headers ⇒ Object
Returns the value of attribute headers.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def headers @headers end |
#inline_attachments ⇒ Object
Returns the value of attribute inline_attachments.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def end |
#subject ⇒ Object
Returns the value of attribute subject.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def subject @subject end |
#template_engine ⇒ Object
Returns the value of attribute template_engine.
3 4 5 |
# File 'lib/unione/helpers/template/template.rb', line 3 def template_engine @template_engine end |
Instance Method Details
#to_json ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/unione/helpers/template/template.rb', line 13 def to_json(*) { template: { id: '', name: self.name, subject: self.subject, template_engine: self.template_engine, global_substitutions: self.global_substitutions, headers: self.headers, body: self.body, attachments: self., inline_attachments: self., options: self. }.merge(self.from) .delete_if { |_, value| value.to_s.strip == '' || value == [] || value == {}} } end |