Sha256: 65e29bf6107b3d9023872b09f3e7a74a2140676ea7ed5e7b175218fff1cf98a2

Contents?: true

Size: 486 Bytes

Versions: 6

Compression:

Stored size: 486 Bytes

Contents

module Coradoc
  module Element
    class Tag < Base
      attr_accessor :name, :prefix, :attrs, :line_break

      def initialize(name, options = {})
        @name = name
        @prefix = options.fetch(:prefix, "tag")
        @attrs = options.fetch(:attribute_list, AttributeList.new)
        @line_break = options.fetch(:line_break, "\n")
      end

      def to_adoc
        attrs = @attrs.to_adoc
        "// #{@prefix}::#{@name}#{attrs}#{@line_break}"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
coradoc-1.1.6 lib/coradoc/element/tag.rb
coradoc-1.1.5 lib/coradoc/element/tag.rb
coradoc-1.1.4 lib/coradoc/element/tag.rb
coradoc-1.1.3 lib/coradoc/element/tag.rb
coradoc-1.1.2 lib/coradoc/element/tag.rb
coradoc-1.1.1 lib/coradoc/element/tag.rb