Class: Meteor::Core::Util::PatternCache
- Inherits:
-
Object
- Object
- Meteor::Core::Util::PatternCache
- Defined in:
- lib/meteor.rb
Overview
Pattern Cache Class (パターンキャッシュクラス)
Constant Summary
- @@regex_cache =
Hash.new
Class Method Summary (collapse)
-
+ (Object) get(*args)
get pattern (パターンを取得する).
Instance Method Summary (collapse)
-
- (PatternCache) initialize
constructor
intializer (イニシャライザ).
Constructor Details
- (PatternCache) initialize
intializer (イニシャライザ)
3067 3068 |
# File 'lib/meteor.rb', line 3067 def initialize end |
Class Method Details
+ (Regexp) get(regex) + (Regexp) get(regex, option)
get pattern (パターンを取得する)
3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 |
# File 'lib/meteor.rb', line 3081 def self.get(*args) case args.length when ONE #get_1(args[0]) if @@regex_cache[args[0].to_sym] then @@regex_cache[args[0].to_sym] else @@regex_cache[args[0].to_sym] = Regexp.new(args[0], Regexp::MULTILINE) end when TWO #get_2(args[0], args[1]) if @@regex_cache[args[0].to_sym] then @@regex_cache[args[0].to_sym] else @@regex_cache[args[0].to_sym] = Regexp.new(args[0], args[1]) end else raise ArgumentError end end |