Class: Eco::API::Common::People::DefaultParsers::SelectParser
- Inherits:
-
BaseParser
- Object
- BaseParser
- Eco::API::Common::People::DefaultParsers::SelectParser
- Defined in:
- lib/eco/api/common/people/default_parsers/select_parser.rb
Instance Method Summary collapse
Methods inherited from BaseParser
Constructor Details
This class inherits a constructor from Eco::API::Common::People::BaseParser
Instance Method Details
#process ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/eco/api/common/people/default_parsers/select_parser.rb', line 8 def process @parsers.define_attribute(:select, dependencies: @options) do |parser| parser.def_parser do |value, deps| = deps[:select_hashes][deps["attr"]] next value if ! if value.is_a?(Array) value.map { |v| [v&.downcase.strip] || v } elsif value [value&.downcase.strip] || value end end.def_serializer do |value| value end end end |