Class: Bullseye
Overview
Represents a bull’s eye, given its characteristics (center, radii, nbr of rings, distance between rings) @see: server.3rd-wing.net/public/Galevsky/Utilisation%20Bullseye.pdf
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.
-
#ring_distance ⇒ Object
readonly
Returns the value of attribute ring_distance.
-
#rings ⇒ Object
readonly
Returns the value of attribute rings.
-
#vradius ⇒ Object
readonly
Returns the value of attribute vradius.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(name, center, hradius, vradius, rings, ring_distance) ⇒ Bullseye
constructor
A new instance of Bullseye.
Methods included from SITACObjects
Constructor Details
#initialize(name, center, hradius, vradius, rings, ring_distance) ⇒ Bullseye
Returns a new instance of Bullseye.
107 108 109 110 111 112 113 114 115 |
# File 'lib/sitac_objects.rb', line 107 def initialize(name, center, hradius, vradius, rings, ring_distance) super @name = name @center = as_point(center) @hradius = hradius / 2 @vradius = vradius / 2 @rings = rings @ring_distance = ring_distance end |
Instance Attribute Details
#center ⇒ Object (readonly)
Returns the value of attribute center.
99 100 101 |
# File 'lib/sitac_objects.rb', line 99 def center @center end |
#hradius ⇒ Object (readonly)
Returns the value of attribute hradius.
99 100 101 |
# File 'lib/sitac_objects.rb', line 99 def hradius @hradius end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
99 100 101 |
# File 'lib/sitac_objects.rb', line 99 def name @name end |
#ring_distance ⇒ Object (readonly)
Returns the value of attribute ring_distance.
99 100 101 |
# File 'lib/sitac_objects.rb', line 99 def ring_distance @ring_distance end |
#rings ⇒ Object (readonly)
Returns the value of attribute rings.
99 100 101 |
# File 'lib/sitac_objects.rb', line 99 def rings @rings end |
#vradius ⇒ Object (readonly)
Returns the value of attribute vradius.
99 100 101 |
# File 'lib/sitac_objects.rb', line 99 def vradius @vradius end |
Instance Method Details
#accept(visitor) ⇒ Object
117 118 119 |
# File 'lib/sitac_objects.rb', line 117 def accept(visitor) visitor.visit_bullseye self end |