Module: Dynamoid::Dumping
- Defined in:
- lib/dynamoid/dumping.rb
Defined Under Namespace
Modules: DeepSanitizeHelper
Classes: ArrayDumper, Base, BinaryDumper, BooleanDumper, CustomTypeDumper, DateDumper, DateTimeDumper, IntegerDumper, MapDumper, NumberDumper, RawDumper, SerializedDumper, SetDumper, StringDumper
Class Method Summary
collapse
Class Method Details
.dump_attributes(attributes, attributes_options) ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/dynamoid/dumping.rb', line 6
def self.dump_attributes(attributes, attributes_options)
{}.tap do |h|
attributes.each do |attribute, value|
h[attribute] = dump_field(value, attributes_options[attribute])
end
end
end
|
.dump_field(value, options) ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/dynamoid/dumping.rb', line 14
def self.dump_field(value, options)
return nil if value.nil?
dumper = find_dumper(options)
if dumper.nil?
raise ArgumentError, "Unknown type #{options[:type]}"
end
dumper.process(value)
end
|
.find_dumper(options) ⇒ Object