Class: Square
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Attributes inherited from Polygon
Instance Method Summary collapse
-
#initialize(size) ⇒ Square
constructor
A new instance of Square.
Constructor Details
#initialize(size) ⇒ Square
Returns a new instance of Square.
251 252 253 254 255 |
# File 'lib/rcad.rb', line 251 def initialize(size) @size = size super([[0,0], [size,0], [size,size], [0,size]]) end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
249 250 251 |
# File 'lib/rcad.rb', line 249 def size @size end |