Method: BootstrapEmail::Compiler#initialize
- Defined in:
- lib/bootstrap-email/compiler.rb
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 |