Module: ViewComponentAttributes::WithRootAttributes

Extended by:
ActiveSupport::Concern
Includes:
ActionView::Helpers::TagHelper, MergeAttributes::Helper, WithAttributes, WithUnknownAttributes
Defined in:
lib/view_component_attributes/with_root_attributes.rb

Instance Method Summary collapse

Methods included from WithUnknownAttributes

#assign_unknown_attribute, #unknown_attributes

Methods included from WithAttributes

#attribute

Instance Method Details

#dynamic_root_attributesObject



100
101
102
103
104
# File 'lib/view_component_attributes/with_root_attributes.rb', line 100

def dynamic_root_attributes
  if respond_to?(:get_default_root_attributes)
    get_default_root_attributes
  end
end

#instance_root_attributesObject



96
97
98
# File 'lib/view_component_attributes/with_root_attributes.rb', line 96

def instance_root_attributes
  attribute(:root_attributes)
end

#root_attributes(**template_attributes) ⇒ Object



86
87
88
89
90
91
92
93
94
# File 'lib/view_component_attributes/with_root_attributes.rb', line 86

def root_attributes(**template_attributes)
  merge_attributes(
    static_root_attributes,
    dynamic_root_attributes,
    template_attributes,
    unknown_attributes,
    instance_root_attributes
  )
end

#static_root_attributesObject



106
107
108
# File 'lib/view_component_attributes/with_root_attributes.rb', line 106

def static_root_attributes
  singleton_class.static_root_attributes
end