Class: Lazylead::Email
- Inherits:
-
Object
- Object
- Lazylead::Email
- Defined in:
- lib/lazylead/email.rb
Overview
An email regarding tickets based on file with markup.
The ‘tilt’ gem was used as a template engine. Read more about ‘tilt’:
- https://github.com/rtomayko/tilt
- https://github.com/rtomayko/tilt/blob/master/docs/TEMPLATES.md
- https://www.rubyguides.com/2018/11/ruby-erb-haml-slim/
- Author
-
Yurii Dubinka ([email protected])
- Copyright
-
Copyright © 2019-2020 Yurii Dubinka
- License
-
MIT
Instance Method Summary collapse
-
#initialize(file, binds) ⇒ Email
constructor
- :file
- the file with html template :binds
-
the template variables for substitution.
-
#render ⇒ Object
Construct the email body from html template based on variables (binds).
Constructor Details
#initialize(file, binds) ⇒ Email
- :file
-
the file with html template
- :binds
-
the template variables for substitution.
62 63 64 65 |
# File 'lib/lazylead/email.rb', line 62 def initialize(file, binds) @file = file @binds = binds end |
Instance Method Details
#render ⇒ Object
Construct the email body from html template based on variables (binds).
68 69 70 71 72 |
# File 'lib/lazylead/email.rb', line 68 def render Tilt.new(@file) .render(OpenStruct.new(@binds)) .delete!("\n") end |