Class: Sevgi::Sundries::RulerEven

Inherits:
Ruler show all
Defined in:
lib/sevgi/sundries/ruler.rb

Overview

Ruler variant that always chooses an even number of major intervals.

If ordinary fitting produces an odd count, one complete major interval is removed and the additional space is distributed through the margins.

Examples:

Reserve symmetric waste when an odd count would fit

ruler = Sevgi::Sundries::RulerEven.new(brut: 50, unit: 1, multiple: 10)
ruler.n       # => 4
ruler.margins # => [5.0, 5.0]

Instance Attribute Summary

Attributes inherited from Ruler

#brut, #finish, #start, #sub

Attributes inherited from Interval

#n, #u

Method Summary

Methods inherited from Ruler

#expand, #initialize, #margins, #ms, #sd, #sn, #su, #waste

Methods inherited from Interval

[], #[], #count, #d, #ds, #h, #hs, #initialize, #nds, #nhs

Constructor Details

This class inherits a constructor from Sevgi::Sundries::Ruler