Class: HtmlEmailCreator::Formatters::PlainTextEmail

Inherits:
Formatter
  • Object
show all
Defined in:
lib/html_email_creator/formatters/plain_text_email.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Formatter

#extension, #id

Constructor Details

#initialize(html, settings) ⇒ PlainTextEmail

Returns a new instance of PlainTextEmail.



12
13
14
15
# File 'lib/html_email_creator/formatters/plain_text_email.rb', line 12

def initialize(html, settings)
  super
  @processor = HtmlEmailCreator::Processor.new(html, settings)
end

Class Method Details

.extensionObject



4
5
6
# File 'lib/html_email_creator/formatters/plain_text_email.rb', line 4

def self.extension
  "txt"
end

.idObject



8
9
10
# File 'lib/html_email_creator/formatters/plain_text_email.rb', line 8

def self.id
  :plain_text_email
end

Instance Method Details

#formatObject



17
18
19
# File 'lib/html_email_creator/formatters/plain_text_email.rb', line 17

def format
  @output ||= @processor.to_plain_text
end