Sha256: 642593ac698ee1aafab5005b59e01734901e83d93176a3ae6ffa3af62d4a517d

Contents?: true

Size: 1.23 KB

Versions: 18

Compression:

Stored size: 1.23 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).process
            DateParser.new(self).process
            MultiParser.new(self).process

            # FORMAT PARSER
            CSVParser.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'
require_relative 'default_parsers/csv_parser'

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
eco-helpers-1.0.8 lib/eco/api/common/people/default_parsers.rb
eco-helpers-1.0.7 lib/eco/api/common/people/default_parsers.rb
eco-helpers-1.0.6 lib/eco/api/common/people/default_parsers.rb
eco-helpers-1.0.5 lib/eco/api/common/people/default_parsers.rb
eco-helpers-1.0.4 lib/eco/api/common/people/default_parsers.rb
eco-helpers-1.0.3 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.9.5 lib/eco/api/common/people/default_parsers.rb
eco-helpers-1.0.2 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.9.4 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.9.3 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.9.2 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.9.1 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.8.4 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.8.3 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.8.2 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.8.1 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.7.2 lib/eco/api/common/people/default_parsers.rb
eco-helpers-0.7.1 lib/eco/api/common/people/default_parsers.rb