Sha256: 637c8800e25e2c221b49e58a47975274044245cc17168f272d2f2bf222542822
Contents?: true
Size: 599 Bytes
Versions: 24
Compression:
Stored size: 599 Bytes
Contents
# frozen_string_literal: true module Maglev module Content class Text < Base # rubocop:disable Rails/OutputSafety def tag(view_context, options = {}) view_context.tag.public_send( options.delete(:html_tag)&.to_sym || tag_name, to_s.html_safe, **{ data: (options.delete(:data) || {}).merge(tag_data) }.merge(options) ) end # rubocop:enable Rails/OutputSafety private def tag_name setting.options[:html] && !setting.options[:line_break] ? :div : :span end end end end
Version data entries
24 entries across 24 versions & 1 rubygems