Class: Ellipse
Overview
Represents a ellipse, given its center and radii
Direct Known Subclasses
Instance Attribute Summary collapse
-
#center ⇒ Object
readonly
Returns the value of attribute center.
-
#hradius ⇒ Object
readonly
Returns the value of attribute hradius.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#vradius ⇒ Object
readonly
Returns the value of attribute vradius.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(name, center, hradius, vradius) ⇒ Ellipse
constructor
A new instance of Ellipse.
Methods included from SITACObjects
Constructor Details
#initialize(name, center, hradius, vradius) ⇒ Ellipse
Returns a new instance of Ellipse.
130 131 132 133 134 135 136 |
# File 'lib/sitac_objects.rb', line 130 def initialize(name, center, hradius, vradius) super @name = name @center = as_point(center) @hradius = hradius / 2 @vradius = vradius / 2 end |
Instance Attribute Details
#center ⇒ Object (readonly)
Returns the value of attribute center.
124 125 126 |
# File 'lib/sitac_objects.rb', line 124 def center @center end |
#hradius ⇒ Object (readonly)
Returns the value of attribute hradius.
124 125 126 |
# File 'lib/sitac_objects.rb', line 124 def hradius @hradius end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
124 125 126 |
# File 'lib/sitac_objects.rb', line 124 def name @name end |
#vradius ⇒ Object (readonly)
Returns the value of attribute vradius.
124 125 126 |
# File 'lib/sitac_objects.rb', line 124 def vradius @vradius end |
Instance Method Details
#accept(visitor) ⇒ Object
138 139 140 |
# File 'lib/sitac_objects.rb', line 138 def accept(visitor) visitor.visit_ellipse self end |