Class: Laser::Cutter::Renderer::Base
- Inherits:
-
Object
- Object
- Laser::Cutter::Renderer::Base
- Defined in:
- lib/laser-cutter/renderer/base.rb
Direct Known Subclasses
BoxRenderer, LayoutRenderer, LineRenderer, MetaRenderer, RectRenderer
Constant Summary collapse
- BLACK =
"000000"
- BLUE =
"4090E0"
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.
10 11 12 13 14 |
# File 'lib/laser-cutter/renderer/base.rb', line 10 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.
8 9 10 |
# File 'lib/laser-cutter/renderer/base.rb', line 8 def config @config end |
#enclosure ⇒ Object
Returns the value of attribute enclosure.
8 9 10 |
# File 'lib/laser-cutter/renderer/base.rb', line 8 def enclosure @enclosure end |
#page_manager ⇒ Object
Returns the value of attribute page_manager.
8 9 10 |
# File 'lib/laser-cutter/renderer/base.rb', line 8 def page_manager @page_manager end |
#subject ⇒ Object
Returns the value of attribute subject.
8 9 10 |
# File 'lib/laser-cutter/renderer/base.rb', line 8 def subject @subject end |
Instance Method Details
#render ⇒ Object
16 17 18 |
# File 'lib/laser-cutter/renderer/base.rb', line 16 def render raise 'Abstract method' end |
#units ⇒ Object
20 21 22 |
# File 'lib/laser-cutter/renderer/base.rb', line 20 def units config.units.to_sym || :mm end |