quickdraw/compilation_equivalence_cases/copied_method.rb

Lines

0%

0 of 9 covered

Branches

—

0 of 0 covered

Methods

0%

0 of 3 covered

Not run
3-611-1214-16
Never called
1# frozen_string_literal: true
2
30module EquivalenceCases
40 module CopiedMethod
50 module Template
60 def heading = h1 { "copied" }
7 end
8
9 # `heading` is copied from Template, whose definition it shares, so it's
10 # left alone while the component's own method compiles.
110 class CopiedMethod < Phlex::HTML
120 define_method(:heading, Template.instance_method(:heading))
13
140 def view_template
150 heading
160 div { "own" }
17 end
18 end
19 end
20end