Class: TMail::TMailScanner
- Defined in:
- lib/tmail/scanner_r.rb,
ext/tmailscanner/tmail/tmailscanner.c
Constant Summary collapse
- Version =
tmp
- MIME_HEADERS =
{ :CTYPE => true, :CENCODING => true, :CDISPOSITION => true }
- PATTERN_TABLE =
{}
Instance Attribute Summary collapse
-
#debug ⇒ Object
TODO: Documentation needed.
Class Method Summary collapse
-
.new ⇒ Object
Creates a new mail.
Instance Method Summary collapse
-
#initialize(str, scantype, comments) ⇒ TMailScanner
constructor
A new instance of TMailScanner.
-
#scan(&block) ⇒ Object
TODO: Documentation needed.
Constructor Details
#initialize(str, scantype, comments) ⇒ TMailScanner
Returns a new instance of TMailScanner.
98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/tmail/scanner_r.rb', line 98 def initialize( str, scantype, comments ) init_scanner str @comments = comments || [] @debug = false # fix scanner mode @received = (scantype == :RECEIVED) @is_mime_header = MIME_HEADERS[scantype] atom, token, @quoted_re, @domlit_re, @comment_re = PATTERN_TABLE[TMail.KCODE] @word_re = (MIME_HEADERS[scantype] ? token : atom) end |
Instance Attribute Details
#debug ⇒ Object
TODO: Documentation needed
125 126 127 |
# File 'ext/tmailscanner/tmail/tmailscanner.c', line 125 def debug @debug end |
Class Method Details
.new ⇒ Object
Creates a new mail
83 84 85 |
# File 'ext/tmailscanner/tmail/tmailscanner.c', line 83 static VALUE mails_s_new(klass, str, ident, cmt) VALUE klass, str, ident, cmt; |
Instance Method Details
#scan(&block) ⇒ Object
TODO: Documentation needed
476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'ext/tmailscanner/tmail/tmailscanner.c', line 476 def scan( &block ) if @debug scan_main do |arr| s, v = arr printf "%7d %-10s %s\n", rest_size(), s.respond_to?(:id2name) ? s.id2name : s.inspect, v.inspect yield arr end else scan_main(&block) end end |