类:Mongoid::StringifiedSymbol
- 继承:
-
对象
- 对象
- Mongoid::StringifiedSymbol
- 定义于:
- lib/mongoid/stringified_symbol.rb
Overview
一个类,它将值作为字符串发送到数据库,但作为符号返回给用户。
类方法摘要折叠
-
。 demogoize (对象) ⇒ 符号
private
将对象从其 mongo 友好的 Ruby 类型转换为此类型。
-
。演变(对象) ⇒ string
private
将对象从Ruby类型转换为MQL查询中使用的类型。
-
。 mongoize (对象) ⇒ string
private
将对象从Ruby类型转换为用于MongoDB持久性的类型。
类方法详细信息
。 demogoize (对象) ⇒符号
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将对象从其 mongo 友好的 Ruby 类型转换为此类型。
18 19 20 21 22 23 24 |
# File 'lib/mongoid/stringified_symbol.rb', line 18 def demogoize(对象) if 对象.nil? 对象 else 对象.to_s.to_sym end end |
。演变(对象) ⇒ string
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将对象从Ruby类型转换为MQL查询中使用的类型。
56 57 58 |
# File 'lib/mongoid/stringified_symbol.rb', line 56 def 发展(对象) mongoize(对象) end |
。 mongoize (对象) ⇒ string
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将对象从Ruby类型转换为用于MongoDB持久性的类型。
37 38 39 40 41 42 43 |
# File 'lib/mongoid/stringified_symbol.rb', line 37 def mongoize(对象) if 对象.nil? 对象 else 对象.to_s end end |