Class: Sevgi::Geometry::Ruler
- Defined in:
- lib/sevgi/geometry/sundries/ruler.rb
Overview
<———————— d = n x sd —————————–><— waste = 2 x margin —> <—– u = unit x multiple —–>
<—— sd = su x sn —–> (computed margin >= given margin)
|———-----------———-|———-----------———-|···························|
<—————————————– brut ———————————————->
Direct Known Subclasses
Instance Attribute Summary collapse
-
#brut ⇒ Object
readonly
Returns the value of attribute brut.
-
#sub ⇒ Object
readonly
Returns the value of attribute sub.
Attributes inherited from Interval
Instance Method Summary collapse
- #expand ⇒ Object
-
#initialize(brut:, unit:, multiple:, margin: 0.0) ⇒ Ruler
constructor
A new instance of Ruler.
- #margin ⇒ Object
- #ms ⇒ Object
- #sd ⇒ Object
- #sn ⇒ Object
- #su ⇒ Object
- #waste ⇒ Object
Methods inherited from Interval
#[], [], #count, #d, #ds, #h, #hs, #nds, #nhs
Constructor Details
Instance Attribute Details
#brut ⇒ Object (readonly)
Returns the value of attribute brut.
62 63 64 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 62 def brut @brut end |
#sub ⇒ Object (readonly)
Returns the value of attribute sub.
62 63 64 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 62 def sub @sub end |
Instance Method Details
#expand ⇒ Object
68 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 68 def = self.class.new(unit: sub.u, multiple: 1, brut: d + waste, margin:) |
#margin ⇒ Object
70 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 70 def margin = @margin ||= waste / 2.0 |
#ms ⇒ Object
72 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 72 def ms = @ms ||= .ds |
#sd ⇒ Object
78 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 78 def sd = @sub.d |
#sn ⇒ Object
76 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 76 def sn = @sub.n |
#su ⇒ Object
80 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 80 def su = @sub.u |
#waste ⇒ Object
74 |
# File 'lib/sevgi/geometry/sundries/ruler.rb', line 74 def waste = @waste ||= brut - d |