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, scope, block) ⇒ Render

Returns a new instance of Render.



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

def initialize(path, scope, block)
  @path = path
  @scope = scope
  @block = block
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



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

def block
  @block
end

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

#scopeObject

Returns the value of attribute scope.



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

def scope
  @scope
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