Class: Laser::Cutter::Renderer::Base
- Inherits:
-
Object
- Object
- Laser::Cutter::Renderer::Base
- Defined in:
- lib/laser-cutter/renderer/base.rb
Overview
subject is what we are rendering enclosure is the rectangle enclosing our subject’s rendered image page_manager contains access to units and page sizes
Direct Known Subclasses
BoxRenderer, LayoutRenderer, LineRenderer, MetaRenderer, RectRenderer
Constant Summary collapse
- BLACK =
"000000"
- BLUE =
"0070E0"
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#enclosure ⇒ Object
Returns the value of attribute enclosure.
-
#page_manager ⇒ Object
Returns the value of attribute page_manager.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(config, subject = nil) ⇒ Base
constructor
A new instance of Base.
- #render ⇒ Object
- #units ⇒ Object
Constructor Details
#initialize(config, subject = nil) ⇒ Base
Returns a new instance of Base.
13 14 15 16 17 |
# File 'lib/laser-cutter/renderer/base.rb', line 13 def initialize(config, subject = nil) self.config = config self.subject = subject self.page_manager = Laser::Cutter::PageManager.new(config.units) end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
11 12 13 |
# File 'lib/laser-cutter/renderer/base.rb', line 11 def config @config end |
#enclosure ⇒ Object
Returns the value of attribute enclosure.
11 12 13 |
# File 'lib/laser-cutter/renderer/base.rb', line 11 def enclosure @enclosure end |
#page_manager ⇒ Object
Returns the value of attribute page_manager.
11 12 13 |
# File 'lib/laser-cutter/renderer/base.rb', line 11 def page_manager @page_manager end |
#subject ⇒ Object
Returns the value of attribute subject.
11 12 13 |
# File 'lib/laser-cutter/renderer/base.rb', line 11 def subject @subject end |
Instance Method Details
#render ⇒ Object
19 20 21 |
# File 'lib/laser-cutter/renderer/base.rb', line 19 def render raise 'Abstract method' end |
#units ⇒ Object
23 24 25 |
# File 'lib/laser-cutter/renderer/base.rb', line 23 def units config.units.to_sym || :mm end |