Class: Triangle
- Defined in:
- ext/ruby/qtruby/examples/ruboids/ruboids/Triangle.rb
Instance Attribute Summary collapse
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(p0 = Point::ORIGIN, p1 = Point::ORIGIN, p2 = Point::ORIGIN) ⇒ Triangle
constructor
A new instance of Triangle.
Constructor Details
#initialize(p0 = Point::ORIGIN, p1 = Point::ORIGIN, p2 = Point::ORIGIN) ⇒ Triangle
Returns a new instance of Triangle.
13 14 15 16 17 18 19 20 |
# File 'ext/ruby/qtruby/examples/ruboids/ruboids/Triangle.rb', line 13 def initialize(p0 = Point::ORIGIN, p1 = Point::ORIGIN, p2 = Point::ORIGIN) @points = [] @points << p0 ? p0 : Point::ORIGIN.dup() @points << p1 ? p1 : Point::ORIGIN.dup() @points << p2 ? p2 : Point::ORIGIN.dup() end |
Instance Attribute Details
#points ⇒ Object
Returns the value of attribute points.
11 12 13 |
# File 'ext/ruby/qtruby/examples/ruboids/ruboids/Triangle.rb', line 11 def points @points end |