类: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 类型转换为此类型。
22 23 24 25 26 27 28 |
# File 'lib/mongoid/stringified_symbol.rb', line 22 def demogoize(对象) if 对象.nil? 对象 else 对象.to_s.to_sym end end |
。演变(对象) ⇒ string
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将对象从Ruby类型转换为MQL查询中使用的类型。
60 61 62 |
# File 'lib/mongoid/stringified_symbol.rb', line 60 def 发展(对象) mongoize(对象) end |
。 mongoize (对象) ⇒ string
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将对象从Ruby类型转换为用于MongoDB持久性的类型。
41 42 43 44 45 46 47 |
# File 'lib/mongoid/stringified_symbol.rb', line 41 def mongoize(对象) if 对象.nil? 对象 else 对象.to_s end end |