quickdraw/compilation_equivalence_cases/shorthand_attributes.rb

Lines

0%

0 of 23 covered

Branches

—

0 of 0 covered

Methods

0%

0 of 7 covered

Not run
3-812-1518-2024-2730-3134-37
Never called
1# frozen_string_literal: true
2
30module EquivalenceCases
40 module ShorthandAttributes
50 class LocalShorthand < Phlex::HTML
60 def view_template
70 title = "Tip"
80 a(href: "/x", title:) { "link" }
9 end
10 end
11
120 class MethodShorthand < Phlex::HTML
130 def view_template
140 a(href: "/x", title:) { "link" }
150 p { @calls.to_s }
16 end
17
180 private def title
190 @calls = (@calls || 0) + 1
200 "Tip"
21 end
22 end
23
240 class SeveralShorthands < Phlex::HTML
250 def view_template
260 id = "main"
270 div(id:, title:, data: { count: }) { "content" }
28 end
29
300 private def title = "Tip"
310 private def count = 3
32 end
33
340 class SoleShorthand < Phlex::HTML
350 def view_template
360 title = "Tip"
370 span(title:)
38 end
39 end
40 end
41end