Class: Postmortem::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/postmortem/index.rb

Overview

Generates and parses an index of previously-sent emails.

Instance Method Summary collapse

Constructor Details

#initialize(index_path, mail_path, mail) ⇒ Index

Returns a new instance of Index.



6
7
8
9
10
# File 'lib/postmortem/index.rb', line 6

def initialize(index_path, mail_path, mail)
  @index_path = index_path
  @mail_path = mail_path
  @mail = mail
end

Instance Method Details

#contentObject



12
13
14
15
# File 'lib/postmortem/index.rb', line 12

def content
  mail_path = @mail_path
  ERB.new(File.read(template_path), trim_mode: '-').result(binding)
end

#sizeObject



17
18
19
# File 'lib/postmortem/index.rb', line 17

def size
  encoded_index.size
end