class Eco::API::Common::People::DefaultParsers
Class to define a set of default attribute parsers
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/eco/api/common/people/default_parsers.rb, line 11 def initialize(*args) super(*args) define_defaults end
Private Instance Methods
define_defaults()
click to toggle source
# File lib/eco/api/common/people/default_parsers.rb, line 18 def define_defaults # Select Options select_hashes = @schema.fields.map do |fld| if fld.type == "select" raise "The schema selection field '#{fld.name}' is missing selection options." unless fld.options && !fld.options.empty? options_hash = fld.options.map { |v| [v.downcase.strip, v] }.to_h [fld.alt_id, options_hash] end end.compact.to_h SelectParser.new(self, select_hashes: select_hashes).process end