Class: Jpmobile::Mobile::Willcom

Inherits:
AbstractMobile show all
Defined in:
lib/jpmobile/mobile/willcom.rb

Overview

Willcom携帯電話

Ddipocketのスーパクラス。

Direct Known Subclasses

Ddipocket

Constant Summary collapse

USER_AGENT_REGEXP =

対応するUser-Agentの正規表現

%r{^Mozilla/3.0\(WILLCOM}
MAIL_ADDRESS_REGEXP =

対応するメールアドレスの正規表現

/.+@((.+\.)?pdx\.ne\.jp|willcom\.com)/

Constants inherited from AbstractMobile

AbstractMobile::MAIL_CHARSET, AbstractMobile::MAIL_CONTENT_TRANSFER_ENCODING

Instance Attribute Summary

Attributes inherited from AbstractMobile

#decorated

Instance Method Summary collapse

Methods inherited from AbstractMobile

add_user_agent_regexp, #apply_filter?, #apply_params_filter?, carrier, check_carrier, #content_transfer_encoding, #decode_transfer_encoding, #decoratable?, #decorated?, #default_charset, #display, #ident, #ident_device, #ident_subscriber, #initialize, ip_address_class, #mail_charset, #mail_variants, #require_related_part?, #smart_phone?, #tablet?, #to_external, #to_internal, #to_mail_body, #to_mail_body_encoded?, #to_mail_encoding, #to_mail_internal, #to_mail_subject, #to_mail_subject_encoded?, user_agent_regexp, #utf8_to_mail_encode, #valid_ip?, valid_ip?, #variants

Constructor Details

This class inherits a constructor from Jpmobile::Mobile::AbstractMobile

Instance Method Details

#positionObject

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



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/jpmobile/mobile/willcom.rb', line 12

def position
  return @__position if defined? @__position
  return @__position = nil if params['pos'].nil? || params['pos'] == ''
  raise 'unsupported format' unless params['pos'] =~ /^N(\d\d)\.(\d\d)\.(\d\d\.\d\d\d)E(\d\d\d)\.(\d\d)\.(\d\d\.\d\d\d)$/

  pos = Jpmobile::Position.new
  pos.lat = Jpmobile::Position.dms2deg(Regexp.last_match(1), Regexp.last_match(2), Regexp.last_match(3))
  pos.lon = Jpmobile::Position.dms2deg(Regexp.last_match(4), Regexp.last_match(5), Regexp.last_match(6))
  pos.tokyo2wgs84!
  @__position = pos
end

#supports_cookie?Boolean

cookieに対応しているか?

Returns:

  • (Boolean)


25
26
27
# File 'lib/jpmobile/mobile/willcom.rb', line 25

def supports_cookie?
  true
end