Class: Dynamoid::TypeCasting::MapTypeCaster

Inherits:
Base
  • Object
show all
Defined in:
lib/dynamoid/type_casting.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dynamoid::TypeCasting::Base

Instance Method Details

#process(value) ⇒ Object



216
217
218
219
220
221
222
223
224
225
226
# File 'lib/dynamoid/type_casting.rb', line 216

def process(value)
  return nil if value.nil?

  if value.is_a? Hash
    value
  elsif value.respond_to? :to_hash
    value.to_hash
  elsif value.respond_to? :to_h
    value.to_h
  end
end