quickdraw/compilation_equivalence_cases/dynamic_attributes.rb

Lines

100%

14 of 14 covered

Branches

—

0 of 0 covered

Methods

100%

2 of 2 covered

1# frozen_string_literal: true
2
31module EquivalenceCases
41 module DynamicAttributes
51 class DynamicAttributes < Phlex::HTML
61 def initialize
76 @cls = "dyn"
86 @attrs = { id: "z", "data-y" => 2 } # rubocop:disable Style/HashSyntax
9 end
10
111 def view_template
126 div(class: @cls) { "1" }
136 div(**@attrs) { "2" }
143 cls = "local"
156 div(class: cls, id: "x") { "3" }
163 div(id: "y", **@attrs)
173 span(class: [@cls, "b"])
186 div(id: (plain "x"; "a")) { "4" }
19 end
20 end
21 end
22end