模块:Mongoid::Extensions::Time
- 定义于:
- lib/mongoid/extensions/time.rb
Overview
为 Time 类添加类型转换行为。
在命名空间下定义
模块: 类方法
实例方法摘要折叠
-
# __mongoize_time__ ⇒ 时间
将时间 Mongoizes 为时间。
-
# mongoize ⇒ 时间 | nil
将对象从我们处理的Ruby类型转换为mongo友好类型。
实例方法详细信息
# __mongoize_time__ ⇒时间
将时间 Mongoizes 为时间。
Time 总是 mongoize 为 Time 实例(它们本身)。
16 17 18 |
# File 'lib/mongoid/extensions/time.rb', line 16 def __mongoize_time__ self end |
# mongoize ⇒时间| nil
将对象从我们处理的Ruby类型转换为mongo友好类型。
27 28 29 |
# File 'lib/mongoid/extensions/time.rb', line 27 def mongoize ::时间.mongoize(self) end |