类:Mongoid::SearchIndexable::Status Private
- 继承:
-
对象
- 对象
- Mongoid::SearchIndexable::Status
- 定义于:
- lib/mongoid/search_indexable.rb
Overview
此类是私有 API 的一部分。 应尽可能避免使用此类,因为它将来可能会被删除或更改。
表示 search_indexes 调用返回的索引的状态。
实例属性摘要折叠
-
#indexes ⇒ Array<Hash>
只读
private
原始索引文档。
实例方法摘要折叠
-
#initialize(indexes) ⇒ Status
构造函数
private
创建一个新的状态对象。
-
#待处理⇒ Array<Hash>
private
返回状态为 == 'PENDING' 的索引子集。
-
# queryable ⇒ Array<Hash>
private
返回标记为“可查询”的索引子集。
-
#准备就绪⇒ Array<Hash>
private
返回状态为 == 'READY' 的索引子集。
-
#准备好了吗? ⇒ true | false
private
如果所有给定索引均已“就绪”且“可查询”,则返回 true。
构造函数详情
#initialize(indexes) ⇒ Status
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
创建一个新的状态对象。
20 21 22 |
# File 'lib/mongoid/search_indexable.rb', line 20 def 初始化(索引) @indexes = 索引 end |
实例属性详细信息
#个索引⇒ Array<Hash> (只读)
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回原始索引文档。
15 16 17 |
# File 'lib/mongoid/search_indexable.rb', line 15 def 索引 @indexes end |
实例方法详细信息
#待处理⇒ Array<Hash>
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回状态为 == 'PENDING' 的索引子集
34 35 36 |
# File 'lib/mongoid/search_indexable.rb', line 34 def 待处理 索引.SELECT { |i| i['status'] == ' PENDING ' } end |
# queryable ⇒ Array<Hash>
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回标记为“可查询”的索引子集
41 42 43 |
# File 'lib/mongoid/search_indexable.rb', line 41 def 可查询 索引.SELECT { |i| i['queryable'] } end |
#准备就绪⇒ Array<Hash>
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回 status == 'READY' 的索引子集
27 28 29 |
# File 'lib/mongoid/search_indexable.rb', line 27 def 准备就绪 索引.SELECT { |i| i['status'] == ' READY ' } end |
#准备好了吗? ⇒ true | false
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
如果所有给定索引均已“就绪”且“可查询”,则返回 true。
48 49 50 |
# File 'lib/mongoid/search_indexable.rb', line 48 def 准备好了吗? 索引.全部? { |i| i['status'] == ' READY ' && i['queryable'] } end |