Class: Scruffy::Renderers::Empty
- Defined in:
- lib/scruffy/renderers/empty.rb
Overview
Scruffy::Renderers::Empty
- Author
-
Brasten Sager
- Date
-
August 17th, 2006
An Empty graph isn’t completely empty, it adds a background componenet to itself before handing other all other layout responsibilities to it’s subclasses or caller.
Instance Attribute Summary
Attributes inherited from Base
Attributes included from Helpers::Canvas
Instance Method Summary collapse
-
#define_layout {|self.components| ... } ⇒ Object
Returns a renderer with just a background.
Methods inherited from Base
#before_render, #initialize, #method_missing, #render
Methods included from Helpers::Canvas
#component, #remove, #reset_settings!
Constructor Details
This class inherits a constructor from Scruffy::Renderers::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Scruffy::Renderers::Base
Instance Method Details
#define_layout {|self.components| ... } ⇒ Object
Returns a renderer with just a background.
If a block is provided, the components array is passed to the block, allowing callers to add components during initialize.
16 17 18 19 20 |
# File 'lib/scruffy/renderers/empty.rb', line 16 def define_layout self.components << Scruffy::Components::Background.new(:background, :position => [0,0], :size =>[100, 100]) yield(self.components) if block_given? end |