Module: DmAdapterSimpledb::Utils

Included in:
DataMapper::Adapters::SimpleDBAdapter, Record
Defined in:
lib/dm-adapter-simpledb/utils.rb

Defined Under Namespace

Classes: NullObject, NullSdbInterface

Instance Method Summary collapse

Instance Method Details

#transform_hash(original, options = {}, &block) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/dm-adapter-simpledb/utils.rb', line 47

def transform_hash(original, options={}, &block)
  original.inject({}){|result, (key,value)|
    value = if (options[:deep] && Hash === value) 
              transform_hash(value, options, &block)
            else 
              value
            end
    block.call(result,key,value)
    result
  }
end