Class: ViewAttributeMerge::Merger
- Inherits:
-
Object
- Object
- ViewAttributeMerge::Merger
- Defined in:
- lib/view_attribute_merge/merger.rb
Overview
Merges HTML view attributes from multiple sources while handling special cases:
-
Stimulus 2.0 data attributes (controller/action/target)
-
Nested data/aria attributes
-
Class attribute concatenation
-
Attribute precedence (First specified wins)
Instance Method Summary collapse
-
#merge(*sources) ⇒ Hash
Merges multiple attribute hashes into a single normalized hash.
Instance Method Details
#merge(*sources) ⇒ Hash
Merges multiple attribute hashes into a single normalized hash
19 20 21 22 23 24 25 |
# File 'lib/view_attribute_merge/merger.rb', line 19 def merge(*sources) @output = {} sources.each { |source| process_source(source) } @output end |