class DocomoWebMailer::AllMailHeaders

メールのヘッダ。素の形に近い( Mimepartspec などは利用しやすいが失われている情報が多い)

Attributes

header[R]

ヘッダ。[ [“ヘッダ名”,“ヘッダ値”] … ] の形式で格納されている。

status[R]

:ok なら取得成功

Public Class Methods

new(status, header) click to toggle source
# File lib/docomo_web_mailer.rb, line 404
def initialize(status, header)
  @status, @header = status, header
end

Public Instance Methods

[]( name ) click to toggle source

header から 対応する名前のヘッダの値を返す。複数ある場合は最初のものを返す。

# File lib/docomo_web_mailer.rb, line 416
def []( name )
  @header.find{|n,a| n==name }[1]
end
content_type() click to toggle source

header から content-type の値を得る

# File lib/docomo_web_mailer.rb, line 420
def content_type
  ['content-type']
end
method_missing(sym, *args, &block) click to toggle source

header に委譲

# File lib/docomo_web_mailer.rb, line 412
def method_missing(sym, *args, &block)
  @header.send sym, *args, &block
end
multipart?() click to toggle source

マルチパートか否か

# File lib/docomo_web_mailer.rb, line 424
def multipart?
  content_type =~ /^multipart\//
end
to_s() click to toggle source

メールのヘッダの形にして返す

# File lib/docomo_web_mailer.rb, line 408
def to_s
  @header.map{|k,v| "#{k}: #{v}" }.join("\n")
end