Module: Laser::Cutter::BoxFactory

Defined in:
lib/laser/cutter/box_factory.rb

Overview

Picks the box a configuration asks for, so a renderer need not know how many kinds there are.

Class Method Summary collapse

Class Method Details

.for(config) ⇒ Box, Sloped::Box

Returns a sloped box when the configuration has a slope.

Parameters:

Returns:

  • (Box, Sloped::Box) —

    a sloped box when the configuration has a slope



10
11
12
# File 'lib/laser/cutter/box_factory.rb', line 10

def self.for(config)
  config[:slope] ? Sloped::Box.new(config) : Box.new(config)
end