Sha256: a8520335c3220e9dda69674fa858602890c16b0704918ce1befe635d88f6064c
Contents?: true
Size: 852 Bytes
Versions: 15
Compression:
Stored size: 852 Bytes
Contents
module Eco module API module Common module People class DefaultParsers class SelectParser < People::BaseParser def process @parsers.define_attribute(:select, dependencies: @options) do |parser| parser.def_parser do |value, deps| options_hash = deps[:select_hashes][deps["attr"]] next value if !options_hash if value.is_a?(Array) value.map { |v| options_hash[v&.downcase.strip] }.compact elsif value options_hash[value&.downcase.strip] end end.def_serializer do |value| value end end end end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems