Class: Square

Inherits:
Polygon show all
Defined in:
lib/rcad.rb

Instance Attribute Summary collapse

Attributes inherited from Polygon

#paths, #points

Instance Method Summary collapse

Constructor Details

#initialize(size) ⇒ Square

Returns a new instance of Square.



239
240
241
242
243
# File 'lib/rcad.rb', line 239

def initialize(size)
  @size = size

  super([[0,0], [size,0], [size,size], [0,size]])
end

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



237
238
239
# File 'lib/rcad.rb', line 237

def size
  @size
end