Class: Laser::Cutter::Renderer::RectRenderer

Inherits:
Base
  • Object
show all
Defined in:
lib/laser/cutter/renderer/rect_renderer.rb

Overview

Strokes the four sides of a rectangle onto a Prawn document.

Constant Summary

Constants inherited from Base

Base::BLACK, Base::BLUE

Instance Attribute Summary

Attributes inherited from Base

#config, #enclosure, #page_manager, #subject

Instance Method Summary collapse

Methods inherited from Base

#document, #initialize, #units

Constructor Details

This class inherits a constructor from Laser::Cutter::Renderer::Base

Instance Method Details

#render(pdf) ⇒ Array<Geometry::Line>

Returns the sides.

Parameters:

  • pdf (Prawn::Document)

Returns:



13
14
15
16
17
# File 'lib/laser/cutter/renderer/rect_renderer.rb', line 13

def render(pdf)
  rect.sides.each do |side|
    LineRenderer.new(config, side).render(pdf)
  end
end