Method: Geometry::Rectangle#width
- Defined in:
- lib/geometry/rectangle.rb
#width ⇒ Number
Returns Width of the Geometry::Rectangle.
172 173 174 175 |
# File 'lib/geometry/rectangle.rb', line 172 def width min, max = @points.minmax {|a,b| a.x <=> b.x} max.x - min.x end |