class TMail::StructuredHeader

Public Instance Methods

comments() click to toggle source
# File lib/tmail/header.rb, line 208
def comments
  ensure_parsed
  if @comments[0]
    [Decoder.decode(@comments[0])]
  else
    @comments
  end
end

Private Instance Methods

do_parse() click to toggle source
# File lib/tmail/header.rb, line 244
def do_parse
  quote_boundary
  quote_unquoted_name
  quote_unquoted_bencode
  obj = Parser.parse(self.class::PARSE_TYPE, @body, @comments)
  set obj if obj
end
parse() click to toggle source
# File lib/tmail/header.rb, line 219
def parse
  save = nil

  begin
    parse_init
    do_parse
  rescue SyntaxError
    if not save and mime_encoded? @body
      save = @body
      @body = Decoder.decode(save)
      retry
    elsif save
      @body = save
    end

    @illegal = true
    raise if @config.strict_parse?
  end
end
parse_init() click to toggle source
# File lib/tmail/header.rb, line 239
def parse_init
  @comments = []
  init
end