Sha256: b9e9f1567f04132b1bb76629d84f7653fcd32a90db145ecfbde63c8ccb0b709e

Contents?: true

Size: 912 Bytes

Versions: 3

Compression:

Stored size: 912 Bytes

Contents

# encoding: utf-8


require 'one_apm/support/rename_rules_engine/rename/base'
require 'one_apm/support/rename_rules_engine/rename/header'
require 'one_apm/support/rename_rules_engine/rename/parameter'
require 'one_apm/support/rename_rules_engine/rename/segment'
require 'one_apm/support/dotted_hash'

module OneApm
  module Support
    class RenameRulesEngine
      module Rename
        module Engine

          extend self

          def create_rename_rules(rename_hash)
            rename_hash = DottedHash.new(rename_hash)
            case rename_hash[:type].downcase
              when 'segments'
                Segment.new(rename_hash)
              when 'parameter'
                Parameter.new(rename_hash)
              when 'header'
                Header.new(rename_hash)
              else
                Base.new(rename_hash)
            end
          end
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oneapm_rpm-1.4.2 lib/one_apm/support/rename_rules_engine/rename/engine.rb
oneapm_rpm-1.4.1 lib/one_apm/support/rename_rules_engine/rename/engine.rb
oneapm_rpm-1.4.0 lib/one_apm/support/rename_rules_engine/rename/engine.rb