Class: Mjml::Render

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, args, instance) ⇒ Render

Returns a new instance of Render.



5
6
7
8
9
# File 'lib/mjml/render.rb', line 5

def initialize(path, args, instance)
  @path = path
  @args = args
  @instance = instance || binding
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



3
4
5
# File 'lib/mjml/render.rb', line 3

def args
  @args
end

#contentObject

Returns the value of attribute content.



3
4
5
# File 'lib/mjml/render.rb', line 3

def content
  @content
end

#instanceObject

Returns the value of attribute instance.



3
4
5
# File 'lib/mjml/render.rb', line 3

def instance
  @instance
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/mjml/render.rb', line 3

def path
  @path
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
# File 'lib/mjml/render.rb', line 11

def execute
  generate_mjml_file
  generate_html_file
  read_html_file
  clear_tmp_files
  content
end