module MailParser::RFC2822

Constants

HEADER_TYPE
ZONE

Public Instance Methods

parse(name, value, opt={}) click to toggle source
# File lib/mailparser/rfc2822.rb, line 207
def parse(name, value, opt={})
  htype = HEADER_TYPE[name.downcase]
  unless htype then
    return value.chomp
  end
  if htype.is_a? Array then
    htype[0]::Parser.new(opt).parse(htype[1], value)
  else
    Parser.new(opt).parse(htype, value)
  end
end