Class: Meta::Scope::And
Overview
逻辑 And 操作
Instance Method Summary collapse
-
#match_scopes?(scopes) ⇒ Boolean
scopes 需要包含所有的 @scopes.
-
#scope_name ⇒ Object
重定义 scope_name,如果用得上的话.
Methods inherited from Composite
concat, #defined_scopes, #initialize, new
Methods included from Base
#and, #defined_scopes, #include_scope, #inspect, #match?, #or, #scope_name=
Constructor Details
This class inherits a constructor from Meta::Scope::Composite
Instance Method Details
#match_scopes?(scopes) ⇒ Boolean
scopes 需要包含所有的 @scopes
127 128 129 |
# File 'lib/meta/scope/base.rb', line 127 def match_scopes?(scopes) @scopes.all? { |scope| scope.match?(scopes) } end |
#scope_name ⇒ Object
重定义 scope_name,如果用得上的话
132 133 134 |
# File 'lib/meta/scope/base.rb', line 132 def scope_name @scope_name || @scopes.map(&:scope_name).sort.join('_and_') end |