Sha256: 380e52cd57e4b38dc0fea0d91ae170e0c97549d1509516bda6e421fd56e5fbc9

Contents?: true

Size: 1.13 KB

Versions: 16

Compression:

Stored size: 1.13 KB

Contents

module Eco
  module API
    module Common
      module People
        class DefaultParsers < PersonParser

          def initialize(*args)
            super(*args)
            define_defaults
          end

          private

          def define_defaults
            # Select Options
            select_hashes = @schema.fields.map do |fld|
              if fld.type == "select"
                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
            BooleanParser.new(self).process
            NumericParser.new(self, schema: @schema).process
            DateParser.new(self).process
            MultiParser.new(self).process
          end

        end
      end
    end
  end
end

require_relative 'default_parsers/select_parser'
require_relative 'default_parsers/boolean_parser'
require_relative 'default_parsers/numeric_parser'
require_relative 'default_parsers/date_parser'
require_relative 'default_parsers/multi_parser'

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
eco-helpers-0.6.17 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.16 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.15 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.13 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.12 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.11 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.9 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.8 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.7 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.6 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.5 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.4 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.3 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.2 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.1 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.6.0 lib/eco/api/common/people/default_parsers.rb