Difference between revisions of "Render Part D Assignment"
Jump to navigation
Jump to search
Line 22: | Line 22: | ||
==Scene== | ==Scene== | ||
include Composite and clean up existing code. | include Composite and clean up existing code. | ||
+ | |||
+ | =Testing Your Solution= | ||
+ | ==Unit Test== | ||
+ | {{RubyUnitTest|part_d_unit_test|render/part_d}} |
Revision as of 05:56, 26 November 2020
In this studio we will evolve our code from Render_Part_C_Assignment to leverage mixins.
Continue editing files in the render/assignment directory.
Contents
Code to Implement
Composite
module Composite should define methods push_component and each_component as well as include the Enumerable module.
push_component
push a component onto an array.
each_component
if a block is given, yield for each component. otherwise return a new Enumerator of the components.
Enumerable
to add a number of useful methods, include the Enumerable module and use alias_method to alias an :each
method to the :each_component
method.
CompositeTransform
include Composite and clean up existing code.
Scene
include Composite and clean up existing code.
Testing Your Solution
Unit Test
file: | src/test/ruby/render/part_d/part_d_unit_test.rb | UnitTest |
note: ensure that you have removed all printing to receive credit for any assignment.