Sha256: 86c30615ca7fc16a6a862aa409577547dd50b34b7a27a9a34f104ccae380dab5

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

module Straightedge
  # some boilerplate to bootstrap a rendering engine
  class Scene
    attr_reader :locations_and_figures

    def initialize(locations_and_figures={})
      @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)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
straightedge-0.1.1 lib/straightedge/scene.rb