Sha256: eac2b96c66c17bb0bd1569eab1750bf2af67534dd3ba8d91805fccb5e5f99786

Contents?: true

Size: 581 Bytes

Versions: 6

Compression:

Stored size: 581 Bytes

Contents

# frozen_string_literal: true

# Work with HTML formatters to DrawIO shapes
module DrawioDsl
  # HTML formatters can be used on shapes to render HTML using a DSL
  module Formatters
    # Create an instance of a HTML formatter on the shape
    class BaseFormatter
      attr_reader :html

      def initialize(element_style_defaults = {})
        @html = DrawioDsl::Formatters::HtmlBuilder.new(element_style_defaults)
      end

      def empty?
        html.empty?
      end

      def as_html(new_line: false)
        html.as_html(new_line: new_line)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
drawio_dsl-0.8.4 lib/drawio_dsl/formatters/base_formatter.rb
drawio_dsl-0.8.3 lib/drawio_dsl/formatters/base_formatter.rb
drawio_dsl-0.8.2 lib/drawio_dsl/formatters/base_formatter.rb
drawio_dsl-0.8.1 lib/drawio_dsl/formatters/base_formatter.rb
drawio_dsl-0.8.0 lib/drawio_dsl/formatters/base_formatter.rb
drawio_dsl-0.7.0 lib/drawio_dsl/formatters/base_formatter.rb