Created
July 29, 2008 15:56
-
-
Save walf443/3114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/jpmobile/request_with_mobile.rb b/lib/jpmobile/request_with_mobile.rb | |
index e6f944c..720e646 100644 | |
--- a/lib/jpmobile/request_with_mobile.rb | |
+++ b/lib/jpmobile/request_with_mobile.rb | |
@@ -24,8 +24,16 @@ module Jpmobile | |
end | |
# 携帯電話からであれば +true+を、そうでなければ +false+ を返す。 | |
- def mobile? | |
- mobile != nil | |
+ # 引数にキャリア名(:docomo, :au など)を指定することで、モバイルであったときにさらにキャリアかどうかの判別ができる | |
+ def mobile?(career=nil) | |
+ return false if mobile.nil? | |
+ | |
+ if career | |
+ return mobile.__send__("#{career.to_s}?") | |
+ else | |
+ return true | |
+ end | |
+ end | |
end | |
# 携帯電話の機種に応じて Mobile::xxx を返す。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment