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, options = {}) ⇒ Parser

Initialize a new MailExtract::Parser object

text - Email message body options - Parsing options

Parsing options include:

:only_head - Skip the rest of the message after quote start (default: false)


15
16
17
18
19
20
21
22
23
24
# File 'lib/mail_extract/parser.rb', line 15

def initialize(text, options={})
  @lines     = []
  @text      = text.strip
  @body      = ""
  @last_type = :text
  @type      = :text
  @options   = options
  
  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