Sha256: 4d83fa22cd2b019dc041f9b6c691a44a1a831a76e5086266362e974222c09801

Contents?: true

Size: 510 Bytes

Versions: 10

Compression:

Stored size: 510 Bytes

Contents

module Storey
  class Unsuffixifier

    def self.unsuffixify(*args)
      self.new(*args).unsuffixify
    end

    def initialize(schema_name)
      @schema_name = schema_name
    end

    def unsuffixify
      schema_names.map do |schema_name|
        if schema_name =~ /(["\$\w]+)#{suffix}/
          $1
        else
          schema_name
        end
      end.join(',')
    end

    private

    def suffix
      Storey.suffix
    end

    def schema_names
      @schema_name.split(',')
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
storey-2.0.2 lib/storey/unsuffixifier.rb
storey-2.0.1 lib/storey/unsuffixifier.rb
storey-2.0.0 lib/storey/unsuffixifier.rb
storey-1.0.0 lib/storey/unsuffixifier.rb
storey-0.6.0 lib/storey/unsuffixifier.rb
storey-0.5.2 lib/storey/unsuffixifier.rb
storey-0.5.1 lib/storey/unsuffixifier.rb
storey-0.5.0 lib/storey/unsuffixifier.rb
storey-0.4.2 lib/storey/unsuffixifier.rb
storey-0.4.1 lib/storey/unsuffixifier.rb