lib/straightedge/scene.rb in straightedge-0.1.1 vs lib/straightedge/scene.rb in straightedge-0.1.2

- old
+ new

@@ -7,14 +7,24 @@ @locations_and_figures = locations_and_figures end def render(adapter=nil) return false unless adapter - @locations_and_figures.each do |location,figure| - figure = Figures::Label.new.says(figure) if figure.is_a?(String) - figure.location = location - presenter = adapter.presenter_for(figure) - presenter.display(figure) + @locations_and_figures.each do |location,f| + if f.is_a?(Array) + f.map do |figure| + Scene.render_figure(figure, location,adapter) + end + else + Scene.render_figure(f, location,adapter) + end end + end + + def self.render_figure(figure,location,adapter) + figure = Figures::Label.new.says(figure) if figure.is_a?(String) + figure.location = location + presenter = adapter.presenter_for(figure) + presenter.display(figure) end end end