Sha256: a838a8ededacf191806d6837ab68cb85753e3ff3950d79e9180661643cf57511

Contents?: true

Size: 431 Bytes

Versions: 6

Compression:

Stored size: 431 Bytes

Contents

# frozen_string_literal: true

module AnnotateRb
  module ModelAnnotator
    class FileNameResolver
      class << self
        def call(filename_template, model_name, table_name)
          filename_template
            .gsub("%MODEL_NAME%", model_name)
            .gsub("%PLURALIZED_MODEL_NAME%", model_name.pluralize)
            .gsub("%TABLE_NAME%", table_name || model_name.pluralize)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
annotaterb-4.5.0 lib/annotate_rb/model_annotator/file_name_resolver.rb
annotaterb-4.4.1 lib/annotate_rb/model_annotator/file_name_resolver.rb
annotaterb-4.4.0 lib/annotate_rb/model_annotator/file_name_resolver.rb
annotaterb-4.3.1 lib/annotate_rb/model_annotator/file_name_resolver.rb
annotaterb-4.3.0 lib/annotate_rb/model_annotator/file_name_resolver.rb
annotaterb-4.2.0 lib/annotate_rb/model_annotator/file_name_resolver.rb