Class: Mailtime::NullTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/mailtime/renderers/null_template.rb

Direct Known Subclasses

NullHTMLTemplate, NullTextTemplate

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mail) ⇒ NullTemplate

Returns a new instance of NullTemplate.



5
6
7
8
# File 'lib/mailtime/renderers/null_template.rb', line 5

def initialize(mail)
  @id = nil
  @content = mail.body.raw_source
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



4
5
6
# File 'lib/mailtime/renderers/null_template.rb', line 4

def content
  @content
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/mailtime/renderers/null_template.rb', line 4

def id
  @id
end

Instance Method Details

#mail_layoutObject



10
11
12
# File 'lib/mailtime/renderers/null_template.rb', line 10

def mail_layout
  NullLayout.new
end

#render(mail) ⇒ Object

doesn’t do anything since we already know the mail.



19
20
21
# File 'lib/mailtime/renderers/null_template.rb', line 19

def render(mail)
  @content
end

#rendererObject



14
15
16
# File 'lib/mailtime/renderers/null_template.rb', line 14

def renderer
  Mailtime::Renderers::ErbRenderer
end