Top Level Namespace
Defined Under Namespace
Classes: Circle, Parallelogram, Pentagon, Polygon, Quadrilateral, Rectangle, Rhombus, Square, Triangle
Instance Method Summary
collapse
Instance Method Details
#Circle(r = rand) ⇒ Object
11
|
# File 'lib/ShapeStruct.rb', line 11
def Circle(r = rand); Circle.new r; end
|
#Parallel(args = Hash.new(0)) ⇒ Object
12
|
# File 'lib/ShapeStruct.rb', line 12
def Parallel(args = Hash.new(0)); Parallelogram.new(args); end
|
#Pentagon(arg = rand) ⇒ Object
#Polygon(*sides) ⇒ Object
1
2
3
4
5
|
# File 'lib/ShapeStruct.rb', line 1
def Polygon(*sides)
s, s.sides = Polygon.new(sides), Array.new
for side in sides; s.sides << side; end
return s
end
|
#Quad(side1 = rand, side2 = rand, side3 = rand, side4 = rand) ⇒ Object
6
|
# File 'lib/ShapeStruct.rb', line 6
def Quad(side1=rand, side2=rand, side3=rand, side4=rand); Quadrilateral.new(side1, side2, side3, side4); end
|
#Rect(l = rand, w = rand) ⇒ Object
7
|
# File 'lib/ShapeStruct.rb', line 7
def Rect( l = rand, w = rand ); Rectangle.new(l,w); end
|
#Rhombus(arg = Hash.new) ⇒ Object
9
|
# File 'lib/ShapeStruct.rb', line 9
def Rhombus(arg = Hash.new); Rhombus.new arg; end
|
#Square(s = rand) ⇒ Object
8
|
# File 'lib/ShapeStruct.rb', line 8
def Square(s = rand); Square.new(s); end
|
#Tri(s1 = rand, s2 = rand, s3 = rand, arg = Hash.new) ⇒ Object
10
|
# File 'lib/ShapeStruct.rb', line 10
def Tri(s1=rand, s2=rand, s3=rand, arg = Hash.new); Triangle.new s1, s2, s3, arg; end
|