Module: ParamsReady::Marshaller::EnumSetMarshallers::StructMarshaller

Extended by:
AbstractMarshaller
Defined in:
lib/params_ready/marshaller/enum_set_marshallers.rb

Class Method Summary collapse

Methods included from AbstractMarshaller

canonicalize_collection

Class Method Details

.canonicalize(definition, hash, context, validator) ⇒ Object



24
25
26
27
28
29
# File 'lib/params_ready/marshaller/enum_set_marshallers.rb', line 24

def self.canonicalize(definition, hash, context, validator)
  canonicalize_collection(definition, context, validator) do |child|
    _, value = child.find_in_hash(hash, context)
    value
  end
end

.marshal(parameter, intent) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/params_ready/marshaller/enum_set_marshallers.rb', line 31

def self.marshal(parameter, intent)
  if intent.marshal? parameter.name_for_formatter
    StructMarshallers::StructMarshaller.marshal(parameter, intent)
  else
    SetMarshaller.marshal(parameter, intent)
  end
end