email関連の処理
# File lib/jpmobile/email.rb, line 47 def convertable?(content_type) if @@converting_content_type.respond_to?(:each) @@converting_content_type.each do |c| return true if content_type.match(c) end end nil end
メールアドレスよりキャリア情報を取得する
param1 |
email メールアドレス |
return |
Jpmobile::Mobileで定義されている携帯キャリアクラス |
# File lib/jpmobile/email.rb, line 13 def detect(email) Mobile.carriers.each do |const| c = Mobile.const_get(const) return c if c::MAIL_ADDRESS_REGEXP && email.match(/^#{c::MAIL_ADDRESS_REGEXP}$/) end nil end
含まれているメールアドレスからキャリア情報を取得する
# File lib/jpmobile/email.rb, line 22 def detect_from_mail_header(header) Mobile.carriers.each do |const| c = Mobile.const_get(const) if c::MAIL_ADDRESS_REGEXP && header.match(/(\S+@[A-Za-z0-9\-\.\_]+)/) && $1.match(/^#{c::MAIL_ADDRESS_REGEXP}$/) return c end end if japanese_mail?(header) return Jpmobile::Mobile::AbstractMobile end nil end
Generated with the Darkfish Rdoc Generator 2.