Sha256: 24508405f510a2bca4cca0a90e273912ac2e2d6d6f0ade3708b5b7d4d942d914

Contents?: true

Size: 647 Bytes

Versions: 4

Compression:

Stored size: 647 Bytes

Contents

# frozen_string_literal: true

module Masking
  class Config
    class TargetColumns
      class Method
        class String
          def initialize(value)
            @string   = value
            @sequence = 0
          end

          def call
            ("'" + output + "'").b
          end

          private

          SEQUENTIAL_NUMBER_PLACEHOLDER = '%{n}' # rubocop:disable Style/FormatStringToken
          attr_reader :string

          def output
            string.sub(SEQUENTIAL_NUMBER_PLACEHOLDER, sequence.to_s)
          end

          def sequence
            @sequence += 1
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
masking-1.1.0 lib/masking/config/target_columns/method/string.rb
masking-1.0.1 lib/masking/config/target_columns/method/string.rb
masking-1.0.0 lib/masking/config/target_columns/method/string.rb
masking-0.0.3 lib/masking/config/target_columns/method/string.rb