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 | ||
| 3 | 1 | module EquivalenceCases |
| 4 | 1 | module DynamicAttributes |
| 5 | 1 | class DynamicAttributes < Phlex::HTML |
| 6 | 1 | def initialize |
| 7 | 6 | @cls = "dyn" |
| 8 | 6 | @attrs = { id: "z", "data-y" => 2 } # rubocop:disable Style/HashSyntax |
| 9 | end | |
| 10 | ||
| 11 | 1 | def view_template |
| 12 | 6 | div(class: @cls) { "1" } |
| 13 | 6 | div(**@attrs) { "2" } |
| 14 | 3 | cls = "local" |
| 15 | 6 | div(class: cls, id: "x") { "3" } |
| 16 | 3 | div(id: "y", **@attrs) |
| 17 | 3 | span(class: [@cls, "b"]) |
| 18 | 6 | div(id: (plain "x"; "a")) { "4" } |
| 19 | end | |
| 20 | end | |
| 21 | end | |
| 22 | end |