Module: ParamsReady::Marshaller::EnumSetMarshallers::AbstractMarshaller

Included in:
ArrayMarshaller, SetMarshaller, StructMarshaller
Defined in:
lib/params_ready/marshaller/enum_set_marshallers.rb

Instance Method Summary collapse

Instance Method Details

#canonicalize_collection(definition, context, validator, freeze: false) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/params_ready/marshaller/enum_set_marshallers.rb', line 8

def canonicalize_collection(definition, context, validator, freeze: false)
  hash = {}
  definition.names.each do |name, definition|
    child = definition.create
    value = yield child
    child.set_from_input(value, context, validator)
    child.freeze if freeze
    hash[name] = child
  end
  [hash, validator]
end