Sha256: 0eeacf48642e18c91f3957d4ed1486877c7c4d7c0beab6e3202ada05200465ab
Contents?: true
Size: 885 Bytes
Versions: 29
Compression:
Stored size: 885 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 module Factory include KLog::Logging FORMATTERS = { klass: DrawioDsl::Formatters::KlassFormatter, class: DrawioDsl::Formatters::KlassFormatter, # alias for klass interface: DrawioDsl::Formatters::InterfaceFormatter }.freeze def format_instance(type) unless FORMATTERS.key?(type) log.error "Unknown formatter type: #{type}" @formatter = nil return formatter end @formatter = FORMATTERS[type].new formatter end def formatter @formatter ||= DrawioDsl::Formatters::BaseFormatter.new end end end end
Version data entries
29 entries across 29 versions & 1 rubygems