Class: HtmlEmailCreator::Formatters::Formatter

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

Direct Known Subclasses

HtmlEmail, PlainTextEmail, UnknownFormatter

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, settings) ⇒ Formatter

Returns a new instance of Formatter.



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

def initialize(text, settings)
  @text = text
  @settings = settings
end

Class Method Details

.extensionObject



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

def self.extension
  raise "extension needs to be defined"
end

.idObject



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

def self.id
  raise "id needs to be defined"
end

Instance Method Details

#extensionObject



26
27
28
# File 'lib/html_email_creator/formatters/formatter.rb', line 26

def extension
  self.class.extension
end

#formatObject

override to implement a correct formatter



18
19
20
# File 'lib/html_email_creator/formatters/formatter.rb', line 18

def format
  @text
end

#idObject



22
23
24
# File 'lib/html_email_creator/formatters/formatter.rb', line 22

def id
  self.class.id
end