Sha256: 13e4817f62ebc2481a64b0cc5d01502a0a118b427e421e2c4e354acab9a64dbc

Contents?: true

Size: 666 Bytes

Versions: 4

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

module AnnotateRb
  module ModelAnnotator
    module ForeignKeyAnnotation
      class Annotation
        HEADER_TEXT = "Foreign Keys"

        def initialize(foreign_keys)
          @foreign_keys = foreign_keys
        end

        def body
          [
            Components::BlankCommentLine.new,
            Components::Header.new(HEADER_TEXT),
            Components::BlankCommentLine.new,
            *@foreign_keys
          ]
        end

        def to_markdown
          body.map(&:to_markdown).join("\n")
        end

        def to_default
          body.map(&:to_default).join("\n")
        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/foreign_key_annotation/annotation.rb
annotaterb-4.12.0 lib/annotate_rb/model_annotator/foreign_key_annotation/annotation.rb
annotaterb-4.11.0 lib/annotate_rb/model_annotator/foreign_key_annotation/annotation.rb
annotaterb-4.10.2 lib/annotate_rb/model_annotator/foreign_key_annotation/annotation.rb