Class: Dynamoid::Dumping::CustomTypeDumper
- Defined in:
- lib/dynamoid/dumping.rb
Overview
any object -> string
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Dynamoid::Dumping::Base
Instance Method Details
#process(value) ⇒ Object
292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/dynamoid/dumping.rb', line 292 def process(value) field_class = @options[:type] if value.respond_to?(:dynamoid_dump) value.dynamoid_dump elsif field_class.respond_to?(:dynamoid_dump) field_class.dynamoid_dump(value) else raise ArgumentError, "Neither #{field_class} nor #{value} supports serialization for Dynamoid." end end |