Class: BootstrapEmail::Compiler
- Inherits:
-
Object
- Object
- BootstrapEmail::Compiler
- Defined in:
- lib/bootstrap-email/compiler.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
Returns the value of attribute doc.
-
#premailer ⇒ Object
Returns the value of attribute premailer.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(input, type: :string, options: {}) ⇒ Compiler
constructor
A new instance of Compiler.
- #perform_full_compile ⇒ Object
Constructor Details
permalink #initialize(input, type: :string, options: {}) ⇒ Compiler
Returns a new instance of Compiler.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bootstrap-email/compiler.rb', line 5 def initialize(input, type: :string, options: {}) BootstrapEmail.() self.type = type case type when :rails @mail = input html = (@mail.html_part || @mail).body.raw_source when :string html = input when :file html = File.read(input) end html = add_layout!(html) sass_load_paths build_premailer_doc(html) end |
Instance Attribute Details
permalink #doc ⇒ Object
Returns the value of attribute doc.
3 4 5 |
# File 'lib/bootstrap-email/compiler.rb', line 3 def doc @doc end |
permalink #premailer ⇒ Object
Returns the value of attribute premailer.
3 4 5 |
# File 'lib/bootstrap-email/compiler.rb', line 3 def premailer @premailer end |
permalink #type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/bootstrap-email/compiler.rb', line 3 def type @type end |
Instance Method Details
permalink #perform_full_compile ⇒ Object
[View source]
22 23 24 25 26 27 |
# File 'lib/bootstrap-email/compiler.rb', line 22 def perform_full_compile compile_html! inline_css! configure_html! finalize_document! end |