Class: Rectangle
Overview
Represents a rectangle, given a starting point, a horizontal length and a vertical length
Instance Attribute Summary collapse
-
#horizontal ⇒ Object
readonly
Returns the value of attribute horizontal.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#vertical ⇒ Object
readonly
Returns the value of attribute vertical.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(name, start, horizontal, vertical) ⇒ Rectangle
constructor
A new instance of Rectangle.
Methods included from SITACObjects
Constructor Details
#initialize(name, start, horizontal, vertical) ⇒ Rectangle
Returns a new instance of Rectangle.
83 84 85 86 87 88 89 |
# File 'lib/sitac_objects.rb', line 83 def initialize(name, start, horizontal, vertical) super @name = name @start = start @horizontal = horizontal @vertical = vertical end |
Instance Attribute Details
#horizontal ⇒ Object (readonly)
Returns the value of attribute horizontal.
77 78 79 |
# File 'lib/sitac_objects.rb', line 77 def horizontal @horizontal end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
77 78 79 |
# File 'lib/sitac_objects.rb', line 77 def name @name end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
77 78 79 |
# File 'lib/sitac_objects.rb', line 77 def start @start end |
#vertical ⇒ Object (readonly)
Returns the value of attribute vertical.
77 78 79 |
# File 'lib/sitac_objects.rb', line 77 def vertical @vertical end |
Instance Method Details
#accept(visitor) ⇒ Object
91 92 93 |
# File 'lib/sitac_objects.rb', line 91 def accept(visitor) visitor.visit_rectangle self end |