Class: Db2Query::Type::String
- Defined in:
- lib/db2_query/type/string.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT =
{ trim: false }
Instance Attribute Summary
Attributes inherited from Value
Instance Method Summary collapse
- #deserialize(value) ⇒ Object
-
#initialize(options = DEFAULT) ⇒ String
constructor
A new instance of String.
- #type ⇒ Object
Methods inherited from Value
#quote, #serialize, #type_name
Constructor Details
Instance Method Details
#deserialize(value) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/db2_query/type/string.rb', line 16 def deserialize(value) value.strip! if [:trim] case value when ::String then if value == "null" nil else ::String.new(value) end else value.to_s end end |
#type ⇒ Object
12 13 14 |
# File 'lib/db2_query/type/string.rb', line 12 def type :string end |