FNAME_TO_CLASS | = | { 'date' => DateTimeHeader, 'resent-date' => DateTimeHeader, 'to' => AddressHeader, 'cc' => AddressHeader, 'bcc' => AddressHeader, 'from' => AddressHeader, 'reply-to' => AddressHeader, 'resent-to' => AddressHeader, 'resent-cc' => AddressHeader, 'resent-bcc' => AddressHeader, 'resent-from' => AddressHeader, 'resent-reply-to' => AddressHeader, 'sender' => SingleAddressHeader, 'resent-sender' => SingleAddressHeader, 'return-path' => ReturnPathHeader, 'message-id' => MessageIdHeader, 'resent-message-id' => MessageIdHeader, 'in-reply-to' => ReferencesHeader, 'received' => ReceivedHeader, 'references' => ReferencesHeader, 'keywords' => KeywordsHeader, 'encrypted' => EncryptedHeader, 'mime-version' => MimeVersionHeader, 'content-type' => ContentTypeHeader, 'content-transfer-encoding' => ContentTransferEncodingHeader, 'content-disposition' => ContentDispositionHeader, 'content-id' => MessageIdHeader, 'subject' => UnstructuredHeader, 'comments' => UnstructuredHeader, 'content-description' => UnstructuredHeader } |
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 67 def internal_new( name, conf ) FNAME_TO_CLASS[name].newobj('', conf, true) end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 47 def new( name, body, conf = DEFAULT_CONFIG ) klass = FNAME_TO_CLASS[name.downcase] || UnstructuredHeader klass.newobj body, conf end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 73 def initialize( body, conf, intern = false ) @body = body @config = conf @illegal = false @parsed = false if intern @parsed = true parse_init end end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 52 def new_from_port( port, name, conf = DEFAULT_CONFIG ) re = Regep.new('\A(' + Regexp.quote(name) + '):', 'i') str = nil port.ropen {|f| f.each do |line| if m = re.match(line) then str = m.post_match.strip elsif str and %r\A[\t ]/ === line then str << ' ' << line.strip elsif %r\A-*\s*\z/ === line then break elsif str then break end end } new(name, str, Config.to_config(conf)) end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 132 def accept( strategy, dummy1 = nil, dummy2 = nil ) ensure_parsed do_accept strategy strategy.terminate end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 117 def body ensure_parsed v = Decoder.new(s = '') do_accept v v.terminate s end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 125 def body=( str ) @body = str clear_parse_status end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 93 def empty? ensure_parsed return true if @illegal isempty? end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 89 def illegal? @illegal end
Source: show
# File rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb, line 85 def inspect "#<#{self.class} #{@body.inspect}>" end