Skip to content

Commit a2293f6

Browse files
committed
@headius avoiding instance_eval on java class solves
1 parent 3f5c1f3 commit a2293f6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

external_library/java/handy/handy_test.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ def setup
1717
def draw
1818
background(234, 215, 182)
1919
fill(0, 255, 0)
20-
handy.instance_eval do
21-
rect(20, 20, 360, 20)
22-
rect(20, 360, 360, 20)
23-
rect(20, 40, 20, 320)
24-
rect(360, 40, 20, 320)
25-
end
20+
draw_borders(handy)
2621
balls.each(&:draw)
2722
end
23+
24+
def draw_borders(renderer)
25+
renderer.rect(20, 20, 360, 20)
26+
renderer.rect(20, 360, 360, 20)
27+
renderer.rect(20, 40, 20, 320)
28+
renderer.rect(360, 40, 20, 320)
29+
end

0 commit comments

Comments
 (0)