Created
July 29, 2008 13:27
-
-
Save walf443/3083 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
index bdbaa13..7daa7e4 100644 | |
--- a/lib/jpmobile/mobile/abstract_mobile.rb | |
+++ b/lib/jpmobile/mobile/abstract_mobile.rb | |
@@ -48,6 +48,15 @@ module Jpmobile::Mobile | |
return false | |
end | |
+ # XXX: lib/jpmobile.rbのautoloadで先に各キャリアの定数を定義してるからできるよ | |
+ Jpmobile::Mobile.constants.each do |career| | |
+ next if self == Jpmobile::Mobile.const_get(career) | |
+ | |
+ define_method "#{career.downcase}?" do | |
+ self.is_a?(Jpmobile::Mobile.const_get(career)) | |
+ end | |
+ end | |
+ | |
private | |
# リクエストのパラメータ。 | |
def params |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment