Class: Mongory::Converters::Converted::Hash
- Inherits:
-
Hash
- Object
- Hash
- Mongory::Converters::Converted::Hash
- Includes:
- Mongory::Converters::Converted
- Defined in:
- lib/mongory/converters/converted.rb
Overview
Converts a flat condition hash into a nested structure. Applies value conversion to each element. This is used for conditions that are hashes of values. It is used internally by the ConditionConverter and ValueConverter to handle the conversion of complex data types into a format suitable for MongoDB queries.
Instance Method Summary collapse
- #deep_merge(other) ⇒ Object
- #deep_merge!(other) ⇒ Object
-
#initialize(other = {}) ⇒ Hash
constructor
A new instance of Hash.
Methods included from Mongory::Converters::Converted
Constructor Details
#initialize(other = {}) ⇒ Hash
Returns a new instance of Hash.
35 36 37 38 39 40 |
# File 'lib/mongory/converters/converted.rb', line 35 def initialize(other = {}) super() other.each_pair do |k, v| self[k] = instance_convert(v) end end |