模块:Mongoid::Matcher::In Private
- 定义于:
- lib/mongoid/matcher/in.rb
Overview
该模块是私有 API 的一部分。 您应尽可能避免使用此模块,因为它将来可能会被删除或更改。
$in表达式的内存中匹配器。
类方法摘要折叠
- 
  
    
      。匹配? (exists、value、condition)→ true | false,布尔值 
    
    
  
  
  
  
  
  
  
  private
  
    返回值是否满足 $in表达式。 
类方法详细信息
。匹配? (exists, value, Condition) ⇒ true | false ,布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回值是否满足 $in表达式。
| 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # File 'lib/mongoid/matcher/in.rb', line 21 module_function def 匹配?(存在, 值, 条件) 除非 阵列 === 条件 提高 Errors::InvalidQuery, " $in 参数必须是大量: #{ Errors :: InvalidQuery . truncate_expr ( condition ) } " end if 阵列 === 值 if 值.任何? { |v| 条件.任何? do |C| EqImplWithRegexp.匹配?(' $in ', v, C) end } then return true end end 条件.任何? do |C| EqImplWithRegexp.匹配?(' $in ', 值, C) end end |