Class: Mailtime::NullLayout

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

Direct Known Subclasses

NullHTMLLayout, NullTextLayout

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullLayout

Returns a new instance of NullLayout.



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

def initialize
  @id = nil
  @content = "#{Mailtime.configuration.yield_keyword}"
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

#formatObject (readonly)

Returns the value of attribute format.



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

def format
  @format
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

Class Method Details

.rendersObject



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

def self.renders
  ['erb']
end

Instance Method Details

#render(mail) ⇒ Object



18
19
20
# File 'lib/mailtime/renderers/null_layout.rb', line 18

def render(mail)
  renderer.new(mail, @content).render
end

#rendererObject



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

def renderer
  Mailtime::Renderers::ErbRenderer
end