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


211
212
213
214
215
216
217
218
219
220
221
# File 'lib/dynamoid/type_casting.rb', line 211

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