Class/Module Index [+]

Quicksearch

Jpmobile::Mobile::Softbank

Softbank携帯電話

Vodafoneのスーパクラス。

Constants

MAIL_ADDRESS_REGEXP

対応するメールアドレスの正規表現 ディズニーモバイル対応

MAIL_CHARSET

メールのデフォルトのcharset

MAIL_CONTENT_TRANSFER_ENCODING

テキスト部分の content-transfer-encoding

USER_AGENT_REGEXP

対応するuser-agentの正規表現

Public Instance Methods

decoratable?() click to toggle source
# File lib/jpmobile/mobile/softbank.rb, line 84
def decoratable?
  true
end
ident_device() click to toggle source
Alias for: serial_number
ident_subscriber() click to toggle source
Alias for: x_jphone_uid
position() click to toggle source

位置情報があれば Position のインスタンスを返す。無ければ nil を返す。

# File lib/jpmobile/mobile/softbank.rb, line 30
def position
  return @__position if defined? @__position
  if params["pos"] =~ /^([NS])(\d+)\.(\d+)\.(\d+\.\d+)([WE])(\d+)\.(\d+)\.(\d+\.\d+)$/
    raise "Unsupported datum" if params["geo"] != "wgs84"
    l = Jpmobile::Position.new
    l.lat = ($1=="N" ? 1 : -1) * Jpmobile::Position.dms2deg($2,$3,$4)
    l.lon = ($5=="E" ? 1 : -1) * Jpmobile::Position.dms2deg($6,$7,$8)
    l.options = params.reject {|x,v| !["pos","geo","x-acr"].include?(x) }
    return @__position = l
  else
    return @__position = nil
  end
end
serial_number() click to toggle source

製造番号を返す。無ければ nil を返す。

# File lib/jpmobile/mobile/softbank.rb, line 17
def serial_number
  @request.env['HTTP_USER_AGENT'] =~ /SN(.+?) /
  return $1
end
Also aliased as: ident_device
to_external(str, content_type, charset) click to toggle source
# File lib/jpmobile/mobile/softbank.rb, line 56
def to_external(str, content_type, charset)
  # UTF-8を数値参照に
  str = Jpmobile::Emoticon.utf8_to_unicodecr(str)
  # 数値参照を絵文字コードに変換
  str = Jpmobile::Emoticon.unicodecr_to_external(str, Jpmobile::Emoticon::CONVERSION_TABLE_TO_SOFTBANK, false)

  [str, charset]
end
to_internal(str) click to toggle source

文字コード変換

# File lib/jpmobile/mobile/softbank.rb, line 50
def to_internal(str)
  # 絵文字を数値参照に変換
  str = Jpmobile::Emoticon.external_to_unicodecr_softbank(Jpmobile::Util.utf8(str))
  # 数値参照を UTF-8 に変換
  Jpmobile::Emoticon::unicodecr_to_utf8(str)
end
to_mail_body(str) click to toggle source

メール送信用

# File lib/jpmobile/mobile/softbank.rb, line 66
def to_mail_body(str)
  to_mail_encoding(str)
end
to_mail_body_encoded?(str) click to toggle source
# File lib/jpmobile/mobile/softbank.rb, line 81
def to_mail_body_encoded?(str)
  Jpmobile::Util.shift_jis?(str)
end
to_mail_internal(str, charset) click to toggle source
# File lib/jpmobile/mobile/softbank.rb, line 69
def to_mail_internal(str, charset)
  # 絵文字を数値参照に変換
  if Jpmobile::Util.utf8?(str) or charset == "UTF-8"
    # UTF-8
    str = Jpmobile::Emoticon.external_to_unicodecr_softbank(Jpmobile::Util.utf8(str))
  elsif Jpmobile::Util.shift_jis?(str) or Jpmobile::Util.ascii_8bit?(str) or charset == mail_charset
    # Shift_JIS
    str = Jpmobile::Emoticon.external_to_unicodecr_softbank_sjis(Jpmobile::Util.sjis(str))
  end

  str
end
x_jphone_uid() click to toggle source

UIDを返す。

# File lib/jpmobile/mobile/softbank.rb, line 24
def x_jphone_uid
  @request.env["HTTP_X_JPHONE_UID"]
end
Also aliased as: ident_subscriber

[Validate]

Generated with the Darkfish Rdoc Generator 2.