Sha256: 215236b5dba4d048551fa97043137f94ad88d4aab758486cc90141b3e1678071
Contents?: true
Size: 857 Bytes
Versions: 181
Compression:
Stored size: 857 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] || v } elsif value options_hash[value&.downcase.strip] || value end end.def_serializer do |value| value end end end end end end end end end
Version data entries
181 entries across 181 versions & 1 rubygems