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