Sha256: 61a8e2de1a73045cf268a3d95d9f4d6da30d7ad331d47488951b234112f9d9e6

Contents?: true

Size: 1005 Bytes

Versions: 17

Compression:

Stored size: 1005 Bytes

Contents

module Eco::API::UseCases::GraphQL::Samples::Location::Service
  module TreeDiff
    module Convertible
      module Parsing
        module Classifications
          include Helpers

          # Input classification values into actual
          # classification values
          CLASSIFICATION_MAPS = {}.freeze

          private

          def transform_classifications(row)
            return row if node_classifications_maping.empty?

            row['classifications'] = into_a(row['classifications']).map do |type|
              node_classifications_map(type)
            end.join('|')
          end

          # Helper to map classifications
          def node_classifications_map(value)
            return value unless node_classifications_maping.key?(value)

            node_classifications_maping[value]
          end

          def node_classifications_maping
            self.class::CLASSIFICATION_MAPS
          end
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
eco-helpers-3.0.21 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.20 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.19 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.18 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.17 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.16 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.15 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.14 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.13 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.12 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.11 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.10 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.9 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.8 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.7 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.6 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.5 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb