module Eco module API module Common module People class DefaultParsers class NumericParser < People::BaseParser def process @parsers.define_attribute(:number, dependencies: @options) do |parser| parser.def_parser do |value, deps| #deps[:schema]&.fields[deps["attr"]].parse_text(value) value = value.to_s.strip == "" ? nil : (value.to_f rescue nil) end.def_serializer do |value| value.is_a?(Array) ? value.map { |v| v.to_s } : value.to_s end end end end end end end end end