Sha256: dd88cdc62823bfe6f6bdc3adc3f0445c946bfbd6eb06de614acb764b8de2d715
Contents?: true
Size: 468 Bytes
Versions: 6
Compression:
Stored size: 468 Bytes
Contents
# custom runnable module module Runnable def run reject!(&:done) each(&:display) end end require 'forwardable' # using forwardable to make a custom enumerable class ShapeSystem include Enumerable, Runnable extend Forwardable def_delegators(:@polygons, :each, :reject!, :<<) attr_reader :bd def initialize(bd) @bd = bd @polygons = [] # Initialize the Array end def add_polygon(x, y) self << CustomShape.new(bd, x, y) end end
Version data entries
6 entries across 6 versions & 1 rubygems