Sha256: 46ada5073f1fed43f8f6ca4353d6c2d116cfb2c9ef3ff9a64eac9282eb5ec7eb

Contents?: true

Size: 871 Bytes

Versions: 4

Compression:

Stored size: 871 Bytes

Contents

# frozen_string_literal: true

module AnnotateRb
  module ModelAnnotator
    module Annotation
      class MainHeader < Components::Base
        # Annotate Models plugin use this header
        PREFIX = "== Schema Information"
        PREFIX_MD = "## Schema Information"

        attr_reader :version

        def initialize(version, include_version)
          @version = version
          @include_version = include_version
        end

        def to_markdown
          header = "# #{PREFIX_MD}"
          if @include_version && version > 0
            header += "\n# Schema version: #{version}"
          end

          header
        end

        def to_default
          header = "# #{PREFIX}"
          if @include_version && version > 0
            header += "\n# Schema version: #{version}"
          end

          header
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
annotaterb-4.13.0 lib/annotate_rb/model_annotator/annotation/main_header.rb
annotaterb-4.12.0 lib/annotate_rb/model_annotator/annotation/main_header.rb
annotaterb-4.11.0 lib/annotate_rb/model_annotator/annotation/main_header.rb
annotaterb-4.10.2 lib/annotate_rb/model_annotator/annotation/main_header.rb