class Draught::Container
Attributes
box[R]
min_gap[R]
Public Class Methods
new(box, opts = {})
click to toggle source
# File lib/draught/container.rb, line 13 def initialize(box, opts = {}) @box = box @min_gap = opts.fetch(:min_gap, 0) end
Public Instance Methods
==(other)
click to toggle source
# File lib/draught/container.rb, line 27 def ==(other) min_gap == other.min_gap && box == other.box end
box_type()
click to toggle source
# File lib/draught/container.rb, line 31 def box_type [:container] end
paths()
click to toggle source
# File lib/draught/container.rb, line 35 def paths [box] end
transform(transformer)
click to toggle source
# File lib/draught/container.rb, line 22 def transform(transformer) transformed_min_gap = Point.new(min_gap,0).transform(transformer).x self.class.new(box.transform(transformer), {min_gap: transformed_min_gap}) end
translate(point)
click to toggle source
# File lib/draught/container.rb, line 18 def translate(point) self.class.new(box.translate(point), {min_gap: min_gap}) end