Sha256: cc2ca03ee993a5179b6610d4eaaa68c8799f3c58a0b4e6e0221c461d5bdd140e

Contents?: true

Size: 1001 Bytes

Versions: 23

Compression:

Stored size: 1001 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

23 entries across 23 versions & 1 rubygems

Version Path
eco-helpers-3.0.4 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.3 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.2 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.1 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-3.0.0 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.25 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.24 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.23 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.22 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.21 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.20 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.19 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.18 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.17 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.16 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.15 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.14 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.13 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.12 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb
eco-helpers-2.7.4 lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible/parsing/classifications.rb