Class: HtmlEmailCreator::Formatters::Markdown
- Inherits:
-
HtmlEmailCreator::Formatter
- Object
- HtmlEmailCreator::Formatter
- HtmlEmailCreator::Formatters::Markdown
- Defined in:
- lib/html_email_creator/formatters/markdown.rb
Class Method Summary collapse
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(text, settings) ⇒ Markdown
constructor
A new instance of Markdown.
Methods inherited from HtmlEmailCreator::Formatter
Constructor Details
#initialize(text, settings) ⇒ Markdown
Returns a new instance of Markdown.
14 15 16 17 |
# File 'lib/html_email_creator/formatters/markdown.rb', line 14 def initialize(text, settings) super @document = Kramdown::Document.new(text, :input => 'markdown') end |
Class Method Details
.extension ⇒ Object
6 7 8 |
# File 'lib/html_email_creator/formatters/markdown.rb', line 6 def self.extension "md" end |
.id ⇒ Object
10 11 12 |
# File 'lib/html_email_creator/formatters/markdown.rb', line 10 def self.id :md end |
Instance Method Details
#format ⇒ Object
19 20 21 |
# File 'lib/html_email_creator/formatters/markdown.rb', line 19 def format @output ||= @document.to_html.strip end |