Class: Maglev::Content::Text

Inherits:
Base
  • Object
show all
Defined in:
app/components/maglev/content/text.rb

Instance Attribute Summary

Attributes inherited from Base

#content, #scope, #setting

Instance Method Summary collapse

Methods inherited from Base

#asset_host, #dom_data, #initialize, #tag_data, #tag_id, #to_s

Constructor Details

This class inherits a constructor from Maglev::Content::Base

Instance Method Details

#tag(view_context, options = {}) ⇒ Object

rubocop:disable Rails/OutputSafety



7
8
9
10
11
12
13
14
15
# File 'app/components/maglev/content/text.rb', line 7

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