module ParamsReady::Marshaller::ArrayMarshallers::AbstractMarshaller

Public Instance Methods

marshal(parameter, intent) click to toggle source
# File lib/params_ready/marshaller/array_marshallers.rb, line 10
def marshal(parameter, intent)
  array = parameter.send(:bare_value)
  definition = parameter.definition
  compact = definition.compact?

  elements = array.map do |element|
    if element.eligible_for_output?(intent)
      element.format_self_permitted(intent)
    end
  end
  elements = elements.compact if compact
  do_marshal(elements, intent, compact)
end