Class: MailExtract::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/mail_extract/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Parser

Initialize a new MailExtract::Parser object

text - Email message body



11
12
13
14
15
16
17
18
# File 'lib/mail_extract/parser.rb', line 11

def initialize(text)
  @lines     = []
  @text      = text.strip
  @body      = ""
  @last_type = :text
  @type      = :text
  parse
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/mail_extract/parser.rb', line 5

def body
  @body
end