模块:Mongoid::Extensions::Float
- 定义于:
- lib/mongoid/extensions/float.rb
Overview
为 Float 类添加类型转换行为。
在命名空间下定义
模块: 类方法
实例方法摘要折叠
-
# __mongoize_time__ ⇒ 时间 | ActiveSupport::TimeWithZone
将浮点数转换为时间,即自纪元以来的秒数。
-
# numeric? ⇒ true
浮点数是数字吗?
实例方法详细信息
# __mongoize_time__ ⇒时间| ActiveSupport::TimeWithZone
将浮点数转换为时间,即自纪元以来的秒数。
16 17 18 |
# File 'lib/mongoid/extensions/float.rb', line 16 def __mongoize_time__ ::时间.区域.at(self) end |
# numeric? ⇒ true
浮点数是数字吗?
26 27 28 |
# File 'lib/mongoid/extensions/float.rb', line 26 def numeric? true end |