Class: Geometry::Triangle Abstract
- Inherits:
-
Object
- Object
- Geometry::Triangle
- Includes:
- ClusterFactory
- Defined in:
- lib/geometry/triangle.rb
Overview
This class is abstract.
Factory class that instantiates the appropriate subclasses
Direct Known Subclasses
EquilateralTriangle, IsoscelesTriangle, RightTriangle, ScaleneTriangle
Class Method Summary collapse
Methods included from ClusterFactory
Class Method Details
.new(point0, point1, point2) ⇒ Object .new(point, length) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/geometry/triangle.rb', line 31 def self.new(*args) if args.size == 3 ScaleneTriangle.new *args elsif args.size == 2 RightTriangle.new args[0], args[1], args[1] end end |