Class: Capuchin::Email
- Inherits:
-
Object
- Object
- Capuchin::Email
- Defined in:
- lib/capuchin/email.rb
Constant Summary collapse
- FILENAME_REGEX =
/^(\d+-\d+-\d+)-(.*)(\.[^.]+)$/
- FRONT_MATTER_REGEX =
/\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
Instance Method Summary collapse
- #content ⇒ Object
- #date ⇒ Object
-
#initialize(dir, filename) ⇒ Email
constructor
A new instance of Email.
- #output_filename ⇒ Object
- #slug ⇒ Object
- #subject ⇒ Object
Constructor Details
Instance Method Details
#content ⇒ Object
28 29 30 |
# File 'lib/capuchin/email.rb', line 28 def content @content ||= @renderer.render(@markdown_content) end |
#date ⇒ Object
16 17 18 |
# File 'lib/capuchin/email.rb', line 16 def date @options['date'] || @date end |
#output_filename ⇒ Object
32 33 34 |
# File 'lib/capuchin/email.rb', line 32 def output_filename "#{date.strftime('%Y-%m-%d')}-#{slug}.html" end |
#slug ⇒ Object
20 21 22 |
# File 'lib/capuchin/email.rb', line 20 def slug @slug end |
#subject ⇒ Object
24 25 26 |
# File 'lib/capuchin/email.rb', line 24 def subject @options['subject'] end |