Class: Laser::Cutter::Renderer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/laser-cutter/renderer/base.rb

Constant Summary collapse

BLACK =
"000000"
BLUE =
"4090E0"

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject

Returns the value of attribute config.



8
9
10
# File 'lib/laser-cutter/renderer/base.rb', line 8

def config
  @config
end

#enclosureObject

Returns the value of attribute enclosure.



8
9
10
# File 'lib/laser-cutter/renderer/base.rb', line 8

def enclosure
  @enclosure
end

#page_managerObject

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

#subjectObject

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

#renderObject



16
17
18
# File 'lib/laser-cutter/renderer/base.rb', line 16

def render
  raise 'Abstract method'
end

#unitsObject



20
21
22
# File 'lib/laser-cutter/renderer/base.rb', line 20

def units
  config.units.to_sym || :mm
end